Is there a way to implement JavaScript or jQuery code that will assign an active class to a dot when it is clicked, while also removing the active class from any other dots in the sequence?
HTML:
<div class="dotnav">
<div class="dot active" title="Sign Up"></div>
<div class="dot" title="hello"></div>
<div class="dot" title="hello"></div>
<div class="dot" title="hello"></div>
<div class="dot" title="hello"></div>
<div class="dot" title="helloup"></div>
</div>
CSS:
.dotnav {
left: 40px;
position: absolute;
top: 50%;
z-index: 9999;
display: block;
}
.dot {
width: 16px;
height: 16px;
border-radius: 100%;
border: 2px solid #CCCCCC;
display: block;
margin-top: 10px;
cursor: pointer;
}
.dot:hover {
border: 2px solid #999999;
background-color: #C9931E;
}
.active {
background-color: #C9931E;
}
Looking for a solution using JavaScript or jQuery where clicking on a dot assigns it the active class and removes the previous dots' active classes.