Opening a Details Element from the URL
#почитать
Say you’ve got a page with a bunch of <details> elements on it.
Your goal is to be able to send someone to that page with one particular details element open.
I was doing just this recently, and my first thought was to do it server-side. If the URL was like website.com/#faq-1 I’d see if faq-1 matches an ID of the details element and I’d put the open attribute on it like <details id="faq-1" open>. But no, you don’t get to have the #hash as part of the URL server side (for whatever reason 🤷♀️).
⏱ Читать статью
#почитать
Say you’ve got a page with a bunch of <details> elements on it.
Your goal is to be able to send someone to that page with one particular details element open.
I was doing just this recently, and my first thought was to do it server-side. If the URL was like website.com/#faq-1 I’d see if faq-1 matches an ID of the details element and I’d put the open attribute on it like <details id="faq-1" open>. But no, you don’t get to have the #hash as part of the URL server side (for whatever reason 🤷♀️).
Please open Telegram to view this post
VIEW IN TELEGRAM
👍5