HTML Concepts
Table of Contents
- HTML Template
- HTML Attributes vs DOM Properties
- Quotes for HTML attribute values
- HTML Boolean Attribute
HTML Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TITLE</title>
</head>
<body>
<h1>HEADING</h1>
<p>CONTENT</p>
</body>
</html>HTML Attributes vs DOM Properties discussion
- There are three attributes:
id,typeandvalue. - Once the browser parses this code, a
HTMLInputElementjavascript object will be created. - There are some properties in this object like
accept,align,attributesetc. - The attributes defined in HTML go into the object's
attributesproperty. DOM nodes like
HTMLInputElementwill have the attributes corresponding properties.
Quotes for HTML attribute values discussion
- Quotes are optional, but it's recommended to consistently use double quotes.
- In other words, quoting doesn't mean that the type of value is string or something.
HTML Boolean Attribute discussion
- The presence of a boolean attribute on an element represents the
truevalue - The values "true" and "false" are not allowed on boolean attributes.