In the HEADER section, there are 4 buttons (B1, B2, B3, B4), each leading to a different page in the same tab.
The background color of the buttons is set to WHITE.
When a specific button is clicked, the entire page reloads and redirects to the corresponding page for that button.
NOTE: The Header section is present on all 4 button pages.
Now, my requirement is:
Upon clicking a button, only the background color of that specific button should change to another color (for example, RED) while the rest remain WHITE.
For instance, if I click on B1, the page should reload, and the background color of B1 should change to RED while the others stay white.
How can this be achieved using Jquery, Java Script, or CSS?
Please assist me.
.HeaderButtons {
width: 15%;
background-color: WHITE;
}
<div id="Header">
<input type="button" name="B1" id="B1" value="B1" class="HeaderButtons">
<input type="button" name="B2" id="B2" value="B2" class="HeaderButtons">
<input type="button" name="B3" id="B3" value="B3" class="HeaderButtons">
<input type="button" name="B4" id="B4" value="B4" class="HeaderButtons">
</div>