html radio onclick javascript

Onclick radio button menggunakan javascript


q> Langsung contoh codingnya :

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

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

<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>



Published by


Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s