Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/glossary/boolean/html/index.md
6532 views
---
title: Boolean attribute (HTML) slug: Glossary/Boolean/HTML page-type: glossary-definition
---

A boolean attribute in HTML is an attribute that can be either true or false.

It is worth noticing that a boolean attribute is true when it is present, and false when it is absent.

Here's an example of a HTML boolean attribute checked:

<!-- The following checkboxes will be checked on initial rendering --> <input type="checkbox" checked /> <input type="checkbox" checked="" /> <input type="checkbox" checked="true" /> <input type="checkbox" checked="false" /> <input type="checkbox" checked="any value" /> <!-- The following checkbox will not be checked on initial rendering --> <input type="checkbox" />

See also