I have a list of multiple choice questions:
<div class="question active">
<p>The first counting tool was the _____.</p>
<button class="btn-a">A) Stepped Reckoned</button>
<button class="btn-b">B) Abacus</button>
<button class="btn-c">C) Aba Zaba</button>
<button class="btn-d">D) Punch Card</button>
</div>
<div class="question">
<p>Who founded IBM and was responsible for tabulating the US Census with a punch card tabulator in only six weeks?</p>
<button class="btn-a">A) Jacquard</button>
<button class="btn-b">B) Hollerith</button>
<button class="btn-c">C) Mark I</button>
<button class="btn-d">D) Babbage</button>
</div>
How can I trigger each of these buttons to submit with the corresponding letter on the keyboard?
The keyboard should only work with the .active question.
Bonus:
Is it possible to allow two keys to trigger the question? For example, since ABCD are spaced around the keyboard it may also be helpful to allow QWER or JKL; to correspond to ABCD to make it easy for one hand keyboard entry.
classattributes