I am using Jquery
This is my HTML Section
<input type="radio" id="admin" value="admin"/>Admin<br>
<input type="radio" id="superadmin" value="superadmin"/>Super Admin<br>
$(document).ready(function() {
var selecctedtype = '';
if (document.getElementById('admin').checked) {
selecctedtype = 'admin';
}
if (document.getElementById('superadmin').checked) {
selecctedtype = 'superadmin';
}
alert(selecctedtype);
});
But i am getting empty alert
This is my jsfiddle
http://jsfiddle.net/kua4tfhd/1/
Could anybody please let me know how to capture it ??