I am trying to figure out how to select all div elements with the same class of "dot" under a parent div in JavaScript. Here is an example structure:
<div id="dots">
<div class="dot"> . </div>
<div class="dot"> . </div>
<div class="dot"> . </div>
...
<div class="dot"> . </div>
</div>
My goal is to apply a certain class to a random element with the class "dot" every 5 seconds using JavaScript. Can someone help me with this?
randomElement.addClass('someClass');