ISSUE
Hello there! I'm facing a challenge where I need to display a div when a button is clicked. The issue arises from having multiple divs with the same class, making it difficult for me to target each individual div...
Image1 Image2 Desired Outcome
As shown in the images, I have two lists, "Personal" and "Grocery", each containing a div named "popup_information". My goal is to make only the corresponding div visible when the button in that list is clicked. For instance, clicking the button in the Grocery list should reveal the div at the bottom of that specific list.
SOLUTION
HTML:
<div ng-repeat="lists in listsdata.lists">
<div id="DIV_24">
<button onClick="document.getElementsByClassName('popup_information').style.visibility='visible'" id="MORE_BUTTON">:</button>
<div class="popup_information">
<a href=""> <button id="DELETE_BUTTON">X</button></a>
<a href=""> <button id="EDIT_BUTTON">E</button></a>
</div>
<a href="#/{{lists.id}}">
<div id="DIV_25">
{{lists.name}}
</div>
<div id="DIV_26">
</div>
</div></a>
</div>
CSS:
#DIV_24 > #MORE_BUTTON {
padding: 5px 5px 5px 5px;
background-color: #fbfbfb;
border-radius: 5px;
position: absolute;
color: #666;
font: normal 700 30px/1 "Calibri", sans-serif;
text-align: center;
right: 10px;
top: 10px;
border-color: transparent;
visibility: hidden;
}
#DIV_24:hover > #MORE_BUTTON{
visibility: visible;
z-index: 200;
}
div.popup_information {
position: absolute;
bottom: 0px;
right: 0px;
left: 0px;
height: 70px;
background-color: #ffffff;
visibility: hidden;
}
I currently do not have any script implemented as I am unsure how to target the specific div I need...
REQUEST
My plan is to show the popup_information when MORE_BUTTON is clicked. However, this task proves challenging due to multiple instances of the div with the same class. Any assistance in updating my CSS or providing a script would be greatly appreciated, as I struggle to grasp the required functionality...