{"id":9371,"date":"2022-10-06T05:10:25","date_gmt":"2022-10-06T05:10:25","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=9371"},"modified":"2022-10-06T05:10:25","modified_gmt":"2022-10-06T05:10:25","slug":"html-checked-attribute","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/10\/06\/html-checked-attribute\/","title":{"rendered":"HTML checked Attribute"},"content":{"rendered":"\n<p>The HTML&nbsp;checked&nbsp;attribute is a boolean attribute and specifies that an &lt;input&gt; element must be checked when the page loads.<\/p>\n\n\n\n<p>You can use this attribute only on the\u00a0&lt;input>\u00a0element (&lt;input\u00a0type=&#8221;checkbox&#8221;>\u00a0and\u00a0\u00a0&lt;input\u00a0type=&#8221;radio&#8221;>).<\/p>\n\n\n\n<p>It is also possible to set the&nbsp;checked&nbsp;attribute after the page loads, with JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"syntax-2\">Syntax<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;input type=\"checkbox|radio\" checked&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-html-span-class-attribute-checked-span-attribute-4\">Example of the HTML&nbsp;checked&nbsp;attribute:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;h2&gt;HTML Form Example&lt;\/h2&gt;\n    &lt;form action=\"\/form\/submit\" method=\"post\"&gt;\n      &lt;input type=\"radio\" name=\"game\" value=\"football\" checked&gt; Football\n      &lt;input type=\"radio\" name=\"game\" value=\"basketball\"&gt; Basketball\n    &lt;\/form&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The HTML&nbsp;checked&nbsp;attribute is a boolean attribute and specifies that an &lt;input&gt; element must be checked when the page loads. You can use this attribute only on the\u00a0&lt;input>\u00a0element (&lt;input\u00a0type=&#8221;checkbox&#8221;>\u00a0and\u00a0\u00a0&lt;input\u00a0type=&#8221;radio&#8221;>). It is also possible to set the&nbsp;checked&nbsp;attribute after the page loads, with JavaScript. Syntax Example of the HTML&nbsp;checked&nbsp;attribute:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[327],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9371"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=9371"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9371\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=9371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=9371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=9371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}