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

c++ - Do gcc's __float128 floating point numbers take the current rounding mode into account? -

java - the value of local variable is not used -