How to get select radiobutton value using its name in jQuery?

Posted by Prashant on Stack Overflow See other posts from Stack Overflow or by Prashant
Published on 2009-06-12T11:10:47Z Indexed on 2010/04/01 22:13 UTC
Read the original article Hit count: 221

Filed under:
|
|
|
|

I am having 4 radiobuttons in my web page like below:

<label for="theme-grey"><input type="radio" id="theme-grey" name="theme" value="grey" />Grey</label>
<label for="theme-grey"><input type="radio" id="theme-grey" name="theme" value="pink" />Pink</label>
<label for="theme-grey"><input type="radio" id="theme-grey" name="theme" value="green" />Green</label>

Now in jQuery I want to get the value of selected radiobutton on click of any radiobutton out of above three. In jQuery we have id (#) and class (.) selectors but what if I want to put event on radiobutotn using thier names? as below?

$("<radiobutton name attribute>").click(function(){});

Please tell me how to solve this problem.

Thanks

© Stack Overflow or respective owner

Related posts about html

Related posts about jQuery