javascript - set groupt of radion value jquery -


i have group ooa radion buttons defined so

<input type="radio" name="required[status]" id="status" value="1">yes </label> <input type="radio" name="required[status]" id="status_1" value="0"> no </label> <input type="radio" name="required[status]" id="status_2" value="2">maybe </label> 

this stores value 0,1,2 in field status in db

later, value db 1, how use jquery check appropriate radio button?

if trying check radio button element value can jquery attribute selector.

click me

you can element value this:

$('[value=value_from_db]').prop("checked", true); 

Comments

Popular posts from this blog

Regex find and replace between <div class="customclass"> and </div> tag -

jpa - Passing entitymanager from reflection method -