I'm trying to add a "previous question" button on a quiz I'm making. After the user answers the first question, I add in a <button class="prevquestion">
, however, when I have the jquery event $(.prevquestion).onClick...
, the code isn't triggered (using chrome javascript debugger) even when the prev class button is added.
I assume this is because jQuery only notices elements on the page when the page loads, so how should I go about allowing the prevquestion button to trigger an onClick event?
This is pseudocode so some syntax may be off, the button click is working for nextquestion, just not prevquestion.
Thanks!