Mengisi Form Input dengan Javascript
How to, cara mengisi input form dengan javascript :
Contoh 1 :
.
Contoh 2 :
Wis mudeng ? :D
Selamat belajar
contoh :
<input type="text" id="saiki" />
letakkan sebelum </body>
<script>
window.onload=document.getElementById("saiki");
var element_jam = document.getElementById("saiki");
element_jam.value = "isinya";
</script>
Contoh 1 :
<html>
<head>
</head>
<body>
<input type="text" id="saiki" />
<script>
window.onload=document.getElementById("saiki");
var element_jam = document.getElementById("saiki");
element_jam.value = "isinya";
</script>
</body>
</html>
.
Contoh 2 :
<html>.
<head>
<script>
function jam(id){
isi = "isinya";
}
</script>
</head>
<body>
<input type="text" id="saiki" />
<script>
/*kie ben pas di buka langsung maca fungsi jam neng form saiki
*/
window.onload=jam("saiki");
//nah angger sing kie ngebaca ndisit id ne form saiki di salin neng variabel element_jam
var element_jam = document.getElementById("saiki");
//terus variabel sing mau kuwe di isi nggo kode sing njerone fungsi 'isi'
element_jam.value = isi;
</script>
</body>
</html>
Wis mudeng ? :D
Selamat belajar
Anjaayyy belajar Js dibarengin bahasa Jawa 👌
ReplyDelete