Jump to content

Use <details> and <summary> tags for spoilers instead of div

Featured Replies

Posted

The Details and Summary tags are a modern and correct way to do spoilers.

It has many advantages over the IPS implementation of spoilers, including naming, accessibility, semantics and the ability to search hidden text in Chrome-based browsers.

MDN docs with demo: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

Recently Browsing 0

  • No registered users viewing this page.