Is there a way to achieve the following scenario:
I have multiple DIVS
<div style="background-color: black;">text1</div>
<div style="background-color: black;">text2</div>
<div style="background-color: black;">text3</div>
<div style="background-color: black;">text4</div>
<div style="background-color: black;">text5</div>
<div style="background-color: black;">text6</div>
Upon clicking on the DIV containing "text5," the background color should change to RED. If the same person clicks on the DIV with "text3," the background color of text5 should revert to black and text3 should turn red. This process should continue for other DIVS as well.
In summary, the background color should switch when another DIV is clicked.
Can this be accomplished using basic JavaScript?