Data Attributes: Storing Your Own Data in Markup
A legitimate way to attach custom information to an element, readable from CSS and JavaScript, without inventing invalid attributes.
The HTML markup language.
120 notes tagged
A legitimate way to attach custom information to an element, readable from CSS and JavaScript, without inventing invalid attributes.
HTML5 is not a version you upgrade to. It is the name for a shift from a frozen specification to a living standard, and for the elements and APIs that...
Two elements with no meaning at all, and that is the point. Learn what they are for, why they are not a failure, and how to know you have too many.
A disclosure widget with no JavaScript, machine readable dates, contact details and a progress bar. Small elements that replace a surprising amount of...
The three most argued about elements in HTML. There are clear tests for each, and once you know them the choice stops being a matter of taste.
Four elements divide a page into regions a screen reader can jump between. Learn the rules for each, including the one that says main appears exactly...
Two pages can look identical and be worlds apart. Semantic markup is what tells browsers, screen readers and search engines what each part of a page a...
Two methods, two very different places for your data. Learn which to use, what is safe in a URL, and why neither is encrypted on its own.
The browser can check most of a form before it is sent, with no JavaScript. Learn the attributes, the CSS hooks, and why none of it replaces server va...
Three button types, one attribute, and a default that causes more accidental submissions than any other rule in HTML.
Three controls with their own rules: a textarea whose value is its content, a file input that needs the right enctype, and hidden fields that are not...
Dropdowns done properly: grouping options, multiple selection, the placeholder option trick, and when a datalist beats a select.