Jumat, 20 April 2012

Objek Input Javascript (form) [ Aplikasi IT Part II ] pertemuan ke-3.2


<html>
<head>
<title> Objek Radio </title>
</head>
<body>
<script languange ="JavaScript">
<!--
function radio(form)
{
var ket = "";
if (form.pria.checked == true)
{
ket = "Pria";
}
else
{
ket = "Wanita";
}
alert('Anda adalah seorang ' +ket);
}
//-->
</script>
<form>
<H2> Contoh penggunaan Objek Radio </H2>
<hr>
<p> <input type = "radio" value = "pria" name = "pria"> Pria </p>
<hr>
<p> <input type = "radio" value = "wanita" name = "wanita"> wanita </p>
<hr>
<p> <input type = "button" value = "CONFIRM" onclick = "radio(this.form)"> </p>
<p> <input type = "reset" value = "RESET"> </p>
</form>
</body>
</html>

Tidak ada komentar:

Posting Komentar