intial commit

This commit is contained in:
aldo 2025-11-17 14:44:16 +07:00
parent 52dd69bfde
commit c4be1b2318

34
week 8.html Normal file
View File

@ -0,0 +1,34 @@
<html>
<head>
<script>
function tampilkan()
{
var nama = document.getElementById("nama").values;
var umur = document.getElementById("umur").value;
document.write(nama);
var Hobi = document.getElementByName("hobi");
for (let i=0;i<Hobi.length;i++)
{
if (Hobi(i).hasAttribute("checked")==true)
document.write(Hobi[1].value);
}
}
</script>
</head>
<body>
<form method="GET" action="hal.html">
Nama : <input type="text" name="nama" id="nama"><br>
Umur : <input type="number" name="umur" id="umur"><br>
Alamat: <input type="text"><br>
Hobi : <input type="checkbox" name="Hobi" value="Baca">Baca
<input type="checkbox" name="Hobi" value="Makan">Makan
<input type="checkbox" name="Hobi" value="Tidur">Tidur
<br><input type="submit" value="kirim dengan GET-Submit">
<!--<input type="button" value="kirim dengan GET-Button" onclick="window.location.href='hal2.html'">-->
<input type="button" value="kirim dengan GET-Button" onclick="tampilkan()">
</form>
</body>
</html>