How can I check a radio button on load, based on it's value?

Posted by Noor on Stack Overflow See other posts from Stack Overflow or by Noor
Published on 2010-05-04T20:05:56Z Indexed on 2010/05/04 20:08 UTC
Read the original article Hit count: 242

Filed under:
|
|

I've got the value of a radio button (r1) and I'm trying to use:

$("input:radio[val=r1]").attr('checked', true);

to check it.

The thing is that I've got three radio buttons in a div, when I check one, the value of the checked button gets stored.

When I reload the page I want the page to check the radio button that was chosen last.

Thanks!

© Stack Overflow or respective owner

Related posts about radiobutton

Related posts about jQuery