Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="../../ajax.googleapis.com/ajax/libs/jquery/1.11.2/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>Note:</b> Check and uncheck the checkbox and then click the button to refresh content.</p> <button>Check value of attr() and prop()</button> <br><br> <input id="check1" type="checkbox" checked="checked"> <label for="check1">Check me</label> <p id="p1"></p> </body> <!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_html_prop_attr by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:15:41 GMT --> </html>
Result:
Try it Yourself - © w3schools.com