[wp-trac] [WordPress Trac] #62549: checked is a boolean attribute
WordPress Trac
noreply at wordpress.org
Mon Nov 25 04:17:37 UTC 2024
#62549: checked is a boolean attribute
----------------------------+------------------------------
Reporter: kkmuffme | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: trivial | Resolution:
Keywords: | Focuses:
----------------------------+------------------------------
Comment (by yogeshbhutkar):
Hi @kkmuffme,
Thanks for raising the ticket. I think `checked='checked'` would work as
expected because HTML treats any value for a boolean attribute (including
checked="checked", checked="true", or even checked="randomText") as
equivalent to the presence of the attribute.
But considering best practices in mind, we can use (just) `checked` there.
Source: https://stackoverflow.com/questions/47743629/input-checkbox-
checked-by-default
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62549#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list