OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Automatically close all the other <details> tags after opening a specific <details> tag

  • Thread starter Thread starter rohan_vg
  • Start date Start date
R

rohan_vg

Guest
Here is my code.


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.

<p>Here is my code.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><details>
<summary>1</summary>
Demo 1
</details>

<details>
<summary>2</summary>
Demo 2
</details>

<details>
<summary>3</summary>
Demo 3
</details></code></pre>
</div>
</div>
</p>

<p>What I want to do is -- if the details of any single <code><details></code> tag is open and I open/view another <code><details></code> tag, then the earlier one should close/hide/minimize. </p>

<p>How can this be achieved?</p>

<p>I'm aware the <code><details></code> tag is not supported in IE or Edge.</p>
 

Latest posts

J
Replies
0
Views
1
jbowerbir
J
Top