i have many input fields like this
<input type="radio" name="name" id="name" onchange="enableTxt()" />
when i click this radio button i wanna capture the id of the radio input. i am using the following code
function enableTxt() {
var id = $(this).attr("id");
alert(id);
}
Am getting this error
a.attributes is undefined
The html
The jQuery
Another option is with JQ
With this your object will be the current this
Try this
pass this to the function
HTML:
JS:
You can pass just the ID from the HTML