fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#p1").html("attr('checked'): " + $("input").attr('checked') + "<br>prop('checked'): " + $("input").prop('checked')); }); }); </script> </head> <body> <p><b>注意:</b>确认或取消选中该复选框,然后单击按钮刷新内容。</p> <button>查看attr() 和 prop() 的值</button> <br><br> <input id="check1" type="checkbox" checked="checked"> <label for="check1">Check me</label> <p id="p1"></p> </body> </html>
运行结果