Published in: JavaScript
Both of these versions work for me: var var_name = $("input[@name=radio_name]:checked").val(); var var_name = $("input[@name='radio_name']:checked").val();
Comments
Subscribe to comments
You need to login to post a comment.

Can you put single quote around 'radio_name' ? They should have this on jQuery site. :)
Can you put single quote around 'radio_name' ? They should have this on jQuery site. :)
Is it possible to edit your own snippet? Im not sure if penguin999 could even add the single quotes. I hope we can edit posts!
I think only original author could edit them. I have to create a new one since I use this snippet on my blog.
sorry to promote my own snippet, I just added the single quotes there:
http://snipplr.com/view/9166/get-radio-button-value-using-jquery/