TUNJANGAN KARYAWAN
<HTML><HEAD>
<TITLE>Program JavaScript </TITLE>
</HEAD>
<BODY bgcolor="white">
<h1>Tunjangan Karyawan 2012</h1>
<table border=2 align=left cellpadding=2 cellspacing=4 bordercolor=black>
<FORM method="post" name="fajar">
<tr>
<td><font size=3 color=green face=courier new>Nama:</font></td>
<td><input type="text" name="nama" size=30 maxlength=30></td>
</tr>
<tr>
<td><font size=3 color=green>Golongan :</font></td>
<td><input type="text" name="golong" size=1 maxlength=2></td>
</tr>
<tr>
<td><font size=3 color=green>Status : </font></td>
<td><input type="text" name="status" size=8 maxlength=10> </td>
</tr>
<tr>
<td> <input type="submit" value="Oke" onclick="tunj()"></td>
<td> <input type="reset" value="Cancel"></td>
</FORM>
</table>
<SCRIPT LANGUANGE="JavaScript">
<!--
function tunj()
{
var pgolong=document.fajar.golong.value;
var pstatus=document.fajar.status.value;
var pnama=document.fajar.nama.value;
if((pgolong=='A'||pgolong=='a')&&(pstatus=='MENIKAH'||pstatus=='menikah'))
{
alert("Nama Anda, "+pnama +"\nTunjangan anda 4 juta" +"\nTerima kasih");
}
if((pgolong=='A'||pgolong=='a')&&(pstatus=='SINGLE'||pstatus=='single'))
{
alert("Nama Anda, "+pnama +"\nTunjangan anda 3 juta" +"\nTerima kasih");
}
if((pgolong=='B'||pgolong=='b')&&(pstatus=='menikah'||pstatus=='MENIKAH'))
{
alert("Nama Anda, "+pnama +"\nTunjangan anda 2 juta" +"\nTerima kasih");
}
if((pgolong=='B'||pgolong=='b')&&(pstatus=='SINGLE'||pstatus=='single'))
{
alert("Nama Anda, "+pnama +"\nTunjangan anda 1 juta" +"\nTerima kasih");
}
}
-->
</SCRIPT>
<br>
<br>
<br>
<br>
<br>
<br>
<h2>Untuk Golongan Ada 2 yaitu A dan B</h2>
<h2>Untuk Status Ada 2 yaitu Menikah dan Single
</BODY>
</HTML>
Terus outputnya gimana Bos
ReplyDeleteoutputnya pop up mas
ReplyDelete