html radio onclick javascript | java php laravel linux mysql sql bootstrap html css query java php laravel linux mysql sql bootstrap html css query: html radio onclick javascript

Thursday, June 2, 2016

html radio onclick javascript

Onclick radio button menggunakan javascript

Bismillah

q> Langsung contoh codingnya :

[sourcecode language="html"]

<html>
<head>
<title>Testing Radio Button</title>
<script type="text/javascript">

function pilih(radio) {
alert('nilai = ' + radio.value);
}

</script>
</head>
<body>
<form name="myform">
<input type="radio" name="radio" value="1" id="A" onclick="pilih(this);" /><label for="A">Pilihan A</label>
<input type="radio" name="radio" value="2" id="B" onclick="pilih(this);" /><label for="B">Pilihan B</label>

</form>
</body>
</html>

[/sourcecode]


Alhamdulillah

No comments:

Post a Comment

saifiahmada.com adalah blog belajar programming Indonesia, membahas lengkap materi bahasa pemrograman: code HTML, CSS, Bootstrap, Desain, PHP, MySQL, coding Java, Query, SQL, dan dunia linux