HTML Expand - with no Javascript!

Published: 14 April 2021
on channel: A shot of code
1,935
92

The HTML 'details' Tag provides and expanded dialog without the need for any Javascript!

Normally to create a expandable area like this we would use some custom Javascript or reach for something like JQuery to help us create. But for simple scenarios this is not longer needed.

We can add a summary tag also that specifies the test that appears in the title of the drop down - so rather than simply saying 'details'

can also have it open by default by placing the 'open' attribute in the details Tag.

Checking 'canisuse.com' and browser coverate is 96% with only Opera mini not having support. So pretty good to use unless you need to support Opera mini!

#shorts


Watch video HTML Expand - with no Javascript! online without registration, duration hours minute second in high quality. This video was added by user A shot of code 14 April 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,935 once and liked it 92 people.