Get value of custom attribute Get value of custom attribute jquery jquery

Get value of custom attribute


Remove the context of your selector:

http://jsfiddle.net/NrQek/1/

 var userType = $("input[name=ctrl_CustomerType]:checked").attr('xmlvalue');        alert("xmlvalue is: " + userType);


Your selector is wrong.

The input element is not children of a element where you are clicking, so you cannot pass this as a context to the selector

var userType = $("input[name=ctrl_CustomerType]:checked").attr('xmlvalue');

Demo: Fiddle