核心提示:input check 状态选择代码实现!DOCTYPE htmlhtml lang=enheadmeta charset=UTF-8titleDocument/title/headbodypinpu...
input check 状态选择代码实现
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <p> <input class="inp" type="checkbox" checked="checked" name="chk"> <input type="text" class="ino"> </p> <script src="https://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(function(){ $('.inp').click(function(){ if($('input[name="chk"]').prop("checked")) { $('.ino').show(); } else $('.ino').hide(); }); }) </script> </body> </html>