Home  >  Article  >  Web Front-end  >  Use jquery method to operate radio so that the default option is _jquery

Use jquery method to operate radio so that the default option is _jquery

WBOY
WBOYOriginal
2016-05-16 17:23:051047browse
Copy code The code is as follows:


Whether to map: < ;/th>

value="1"/>< label for="yes">YES
value="0"/> ;



Use jquery method to make it default The option is.
Copy code The code is as follows:

$(function () {
var sfys = "<#if os??&&os.sfys??>${os.sfys}";
if (sfys == '1') {
$( "#yes").attr('checked', 'checked');
} else {
$("#no").attr('checked', 'checked');
}
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn