Home >Web Front-end >JS Tutorial >jquery checkbox implementation of radio selection example_jquery

jquery checkbox implementation of radio selection example_jquery

WBOY
WBOYOriginal
2016-05-16 17:12:14834browse
复制代码 代码如下:

$(function(){
$(':checkbox[name=flag]').each(function(){
$(this).click(function(){
if($(this).attr('checked')){
$(':checkbox[name=flag]').removeAttr('checked');
$(this).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