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

apache - Cloudflare bug random 302 redirections -

java - Sql binding in Spring throws org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException -