JavaScript toggle function
JavaScript toggle function
function myFunction1() {
var element = document.getElementById("myDIV");
if (element.classList) {
element.classList.toggle("dropdown-li");
} else {
var classes = element.className.split(" ");
var i = classes.indexOf("dropdown-li");
if (i >= 0)
classes.splice(i, 1);
else
classes.push("dropdown-li");
element.className = classes.join(" ");
}
}
<ul>
<li class="dropdown">
<a href="#" onclick="myFunction1()" class="dropbtn"> Leistungen <span> = <span></a>
<div class="dropdown-li" id="myDIV">
<a href="#">Privatumzug</a>
<a href="#">Privatumzug</a>
<a href="#">Privatumzug</a>
<a href="#">Privatumzug</a>
<a href="#">Privatumzug</a>
</div>
</li>
</ul>
Post A Comment
No comments :
Thanks For visiting Infotech Solutuion Blog