My question is a bit different from other questions asked before because I mainly want to active the but(not only fire it). Here is my syntx:
$("#second_btn").click(function(){
$('#first_btn').addClass('active');
})
#first_btn{
background-color: green;
}
#first_btn:active{
background-color: yellow;
}
#first_btn.active{
background-color: yellow;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id="first_btn">
first_btn
</button>
<button id="second_btn">
second_btn
</button>
Basically what I am looking for is when the second button is clicked I want the first button be fired and the colour of the button(first) should also be changed to yellow as if button one is clicked.
Here is a jsFiddle version of it: click here
Can you help me identify what I am missing?