Radio button onChange function

vicoxl16

New Member
I have a small problem. What is wrong with this function? I have no idea. I need pop-up alert window when the radio button is selected. Thanks for every reply.HTML\[code\]<input type="radio" name="radioButton" class="choice" value="http://stackoverflow.com/questions/15843554/1"><input type="radio" name="radioButton" class="choice" value="http://stackoverflow.com/questions/15843554/2"><input type="radio" name="radioButton" class="choice" value="http://stackoverflow.com/questions/15843554/3">\[/code\]JavaScript\[code\]var FormFields ={ init: function() { var radio = document.getElementsByName("radioButton"); radio.onchange = FormFields.showAlert; }, showAlert: function() { alert("Bye!"); },};\[/code\]
 
Top