Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 17:23:05
Original
1062 people have browsed it
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');
}
});
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!