+ 5
Can anyone fix toggle? [Solved]
6 Antworten
+ 6
You have not defined active class in css
i.e.
.active{
//Put you css here to perform on clicking the button
}
+ 5
$(document).ready(function(){
$(".container").click(function(){
$("span").toggle();
});
});
+ 5
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".container").click(function(){
$("span").toggle();
});
});
</script>
+ 4
.toggle.active {
}
Not
.toggle:active {
}
+ 3
Define active class
+ 2
Yeah fixed it thank you ☺️