I have some buttons below in my HTML:
<p>
<input class=answerBtns name=answer type=button value=A />
<input class=answerBtns name=answer type=button value=B />
<input class=answerBtns name=answer type=button value=C />
<input class=answerBtns name=answer type=button value=D />
<input class=answerBtns name=answer type=button value=E />
</p>
What I want to know if lets say I want the user to select 3 buttons for example, then if the user clicks on a button, it will highlight the button in a color (lets say green) but the user can only have three buttons selected. If an additional button is clicked then that button would not be selected. The additional button can only be selected if the user unselects a selected button and then selects the button he wishes. This means that only 3 buttons can be selected at maximum.
My question is that what functions in Javacsript can be used to be able to do this?
Thank You