I am trying to figure out how to change the color of my "footertext" to red when I click on either the "left" or "center" containers. Then, I want it to go back to white when I click on any of the containers (left, right, center).
This is my current HTML:
<p class="footertext" style="color:red">Designed by Clarke Cribb<br></p>
<div class="container" id= "left" >
<h1 style="color:white"><a>HAIR</a></h1>
</div>
<div class= "container" id= "center">
<h1 style="color:white"><a>BEAUTY<a/></h1>
</div>
<div class="container" id= "right">
<h1 style="color:white"><a>BARBERS</a></h1>
</div>
</div>
Here is my JavaScript:
<script>
$(document).ready(function(){
$("#left, #center").click(function(){
$("footertext").css("color","red");
});
$(".container").click(function(){
$("footertext").css("color","white");
});
});
</script>
If anyone has a solution, I would greatly appreciate it. Thank you! - Clarke