A void element is an element whose content model never allows it to have contents under any circumstances. Void elements can have attributes. The following is a complete list of the void elements in HTML :Â area , base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr.
Data Attributes
data-*attributes enable us to add additional information to standard, semantic HTML elements without resorting to non-standard attributes or extra properties on the DOM.
Access values in JS
Access values in CSS
From
Input
Options
fieldset - group form controls
đź’ˇ
Every <button> element inside a form works as a Submit button by default. However, when you don't want this behavior (e.g. when using a <button> to toggle visibility of a password field), you can add type="button" to the <button> to disable the default Submit behavior.
How can you submit a form?
Clicking a <button> element, using the Enter key, clicking an <input> element with type='submit'.
Â
Validation
Attributes
required
minlength
pattern="[a-z]{2,20}”
Change the default error message
Ensure users comprehend the validation rules by connecting the form control to an element that explains them. To achieve this, add an aria-describedby attribute to the element, with the id of the form.
Css pseudo classes related to input fields::
:invalid (Invalid form fields are already marked as :invalid
 before user interaction, which may confuse users)
:user-invalid (The styles are only applied after user interaction, this feature is in experiments so only firefox support it)
:required
:valid
:autofill
Â
Check evether a field in a form is validated ele.validity.valid
Â
Image/Picture
The <picture> element provides image versions for different display/device scenarios by containing zero or more <source> elements and one <img> element. The browser selects the most suitable child <source> element, or if none match, it selects the URL in the src attribute of the <img> element. The selected image is then displayed in the space occupied by the <img> element.
Â
Provide different resolutions for different devices.
The 1x and 2x in the srcset above are pixel density descriptors, which means:
When the screen's dpr = 1, use the image images/illustration-small.png.
When the screen's dpr = 2, use the image images/illustration-big.png.
If the srcset syntax is not supported, src='illustration-small.png' will be the final fallback plan.
Â
Consider the device width
The meaning of sizes = "(min-width: 600px) 600px, 300px is:
If the current CSS pixel width of the screen is greater than or equal to 600px, then the CSS width of the image is 600px.
Not support Light-dismiss functionality. Clicking outside of the popover area will close the popover and return focus.
popover
Popovers are great when you want to position an alert, modal, or notification based on the viewport. But popovers are also useful for menus, tooltips, and other elements that need to be positioned relative to other elements.
Light-dismiss functionality. Clicking outside of the popover area will close the popover and return focus.
Accessible keyboard bindings. Hitting the esc key will close the popover and return focus.
Promotion to the top layer: don’t have to futz around with z-index.