search

Home  >  Q&A  >  body text

What does it mean in HTML 5 when an attribute is a boolean?

What does it mean when a property like a hidden property is a boolean property? Can someone explain it in layman's terms?

P粉232793765P粉232793765399 days ago843

reply all(1)I'll reply

  • P粉131455722

    P粉1314557222023-10-21 13:47:28

    As mentioned before, a Boolean property is a property that evaluates to true or false.

    However, according to the HTML5 specification - http://www.w3 .org/TR/html5/infrastruct.html#boolean-attributes

    Please note that this means that is not allowed in HTML5 .

    The correct thing to do is or or or any of them case insensitive and single quotes/no Quoted variant. All of these will evaluate to true.

    Considered false only if the attribute is completely missing.

    reply
    0
  • Cancelreply