Is there any way i can toggle X inside of these circles with a simple toggle in JS? I tried it multiple times half of a day but couldnt make it work in any way.
HTML:
<div class="wrapper">
<ul>
<li><p>X</p></li>
<li><p>X</p></li>
<li><p>X</p></li>
<li><p>X</p></li>
</ul>
</div>
CSS:
ul li {
display: inline-block;
border: 1px solid black;
border-radius: 50%;
height: 150px;
width: 150px;
margin-left: 10px;
margin-right: 10px;
}
p {
font-size: 50px;
display: none;
}
.turning {
display: block;
}
JS:
var li = document.getElementsByTagName("p");
var text = li.innerHTML;
li.addEventListener("click", function() {
var g = this.classList.toggle("turning");
text = g;
});