How to use radio on change event?
You can use this which refers to the current input element. http://jsfiddle.net/4gZAT/ Note that you are comparing the value against allot in both if statements and :radio selector is deprecated. In case that you are not using jQuery, you can use the document.querySelectorAll and HTMLElement.addEventListener methods: