SO - 16916503
by Arun P Johny
HTML
<a href="#" id="selector">Test</a><br />
<input type="radio" name="ctrl_CustomerType" id="ctrl_CustomerType_1" xmltag="CustomerType" xmlvalue="existingCustomer" checked="checked"> Yes
<br />
<input type="radio" name="ctrl_CustomerType" id="ctrl_CustomerType_2" xmltag="CustomerType" xmlvalue="newCustomer"> No
JavaScript
$("#selector").click(function () {
function SubmitTracking() {
var userType = $("input[name=ctrl_CustomerType]:checked").attr('xmlvalue');
alert("xmlvalue is: " + userType);
}
SubmitTracking();
});