I’m generating several divs with id=”RG”:
<div id="rg"></div>
<div id="rg"></div>
<div id="rg"></div>
If I was to click on the first div, how could I hide every div but the div clicked.
<div id="rg"></div> <-- Clicked (Keep)
<div id="rg"></div> <-- Hide
<div id="rg"></div> <-- Hide
First, you can/should only use an ID once i.e. each ID attribute’s value must be unique.
Second, it would look like this