I am new to jQuery and I have read through threads on this topic, but I am having some trouble understanding the logic and after re-writing my code, I'm still unable to get it to work.
I have two buttons and I would like for each one to change the background color and text color on click. Here is a link to my jsfiddle
Any feedback or advice would be very appreciated. Thanks!
jQuery(document).ready(function() {
$("#footer").on("click", "#purple', function() {
$(this).css("background-color", "#9683ec");
$(this).css("color", "#2d2746");
});
$("footer").on("click", "#blue', function() {
$(this).css("background-color", "#00bfff");
$(this).css("color", "#002633");
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>