If you visit this Bootstrap page, then click the button labeled “Button with data-target,” some hidden content is displayed. It doesn’t disappear until you click the button again.
I have jQuery and Bootstrap both enabled on my site, but when I add this code, it does just the opposite: The content is displayed until you click the button. Can anyone tell me how to reverse engineer this gizmo so it does the opposite? I want it to hide the content by default, displaying only when someone clicks on the button.
That’s a special rule I added to collapse all the headings in my articles in mobile devices, similar to Wikipedia’s mobile pages. In other words, if you view a page in a cell phone, you’ll just see a series of headings (with the h2 tag)…
Introduction
Origin
Summary
Clicking on any of the above headings will reveal the content.
So I now have a new question…how can I modify the script I posted above so that it only affects h2 elements inside the article tag?..