You can use the `loading=lazy` attribute to defer the loading of the image until the user scrolls to them.
2. Use the `<datalist>` element to create native HTML autocomplete.
3. Email, call, and SMS links:
4. Ordered lists `start` attribute.
Use the `start` attribute to change the starting point for your ordered lists.
5. Use `<input type="reset">` to create clear button for your forms.
6. The `meter` element
You can use the `<meter>` element to display quantities. No JavaScript/CSS is needed.
7. `window.opener`
Pages opened with `target="_blank"` allow the new page to access the original’s `window.opener`. This can have security and performance implications. Include `rel="noopener"` or `rel="noreferrer"` to prevent this.
8. Base Element
If you want to open all links in the document in a new tab, you can use <base> element:
9. Favicon cache busting
To refresh your website’s favicon you can force browsers to download a new version by adding ?v=2 to the filename.
This is especially helpful in production to make sure the users get the new version.
10. Native HTML sliders
You can use `<input type="range">` to create sliders.
11. HTML Accordion
You can use the `details` element to create a native HTML accordion.
12. `mark` tag
You can use the `<mark>` tag to highlight text.
13. Use the `type="search"` for your search inputs and you get the "clear" button for free.
14. `download` attribute
You can use the `download` attribute in your links to download the file instead of navigating to it.
15. Performance tip
Use the `.webp` image format to make images smaller and boost the performance of your website.
16. Use the `poster` attribute to specify an image to be shown while the video is downloading, or until the user hits the play button.
17. Use the `spellcheck` attribute to define whether the element may be checked for spelling errors.
18. Use the `<optgroup>` element to create a grouping of options within a `<select>` element.
19. You can use the `<fieldset>` element to group several controls as well as labels (`<label>`) within a web form.
If you're learning HTML, CSS or JavaScript be sure to follow me and never miss tips like this.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
EdX offers interactive online courses from the best universities in the world (MITx, HarvardX, BerkeleyX...).
Subjects include biology, economics, chemistry, computer science, business and more.
1. Responsive Web Design 2. JavaScript Algorithms and Data Structures 3. Frontend Libraries 4. Information Security 5. Scientific Computing with Python
...
There are 26 modules to explore, all created by Google trainers, and packed with practical exercises and real-world examples to help you turn knowledge into action.
Using `console.log()` for JavaScript debugging is the most common practice. But, there is more…
🧵
1/ The most common Console methods:
console.log() – For general output of logging information.
console. info() – Informative logging.
console.debug() – A message to the console with the log level debug.
console.warn() – A warning message.
console.error() – An error message.
2/ Custom CSS styles for a console.log():
The `console.log` output can be styled in DevTools using the CSS format specifier.