Automatically close all the other <details> tags after opening a specific <details> tag
问题 Here is my code. <details> <summary>1</summary> Demo 1 </details> <details> <summary>2</summary> Demo 2 </details> <details> <summary>3</summary> Demo 3 </details> What I want to do is -- if the details of any single <details> tag is open and I open/view another <details> tag, then the earlier one should close/hide/minimize. How can this be achieved? I'm aware the <details> tag is not supported in IE or Edge. 回答1: Another approach, slightly shorter, slightly more efficient, without