Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <input id="input" type="checkbox" checked> checkbox <script> alert(input.getAttribute('checked')); // the attribute value is: empty string alert(input.checked); // the property value is: true </script> </body> </html>