I'm setting up a quiz where I can choose the number of questions to be populated by php.
When the last question is cleared it displays a new content.
But I'd like to display it only when one of the button is clicked. Because the buttons are populated with php I can't use a custom ID. So I'd like to trigger an event (a popup window) if one of the button is click and stop the event that display the next content.
Unfortunatly I can't achieve this.
Tried to use event.propagation, but my knowledge in coding is so low I don't even know what I do.
$(document).on("click", "#q3a2", function newPopup(url) {
popupWindow = window.open(
"./gluck.html",'popUpWindow','height=10vh,width=auto,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
});
if ($(".questionStep").length <= 0 ) {
$("#Box1").hide();
$("#NewContent").show();
}
<div id="Box1" class="cearfix" style="">
[…]
<article id="step3" class="questionStep clearfix" data-step="3" style="">
<button onclick="scrollToTop()" class="stepButton yesBtn s3" data-step="3" id="q3a1">Yes</button>
<button onclick="scrollToTop()" class="stepButton yesBtn s3" data-step="3" id="q3a2">No</button>
</article>
</div>
At the moment I can pop up the window but the newcontent is displayed. I'd like it to stay hidden until q3a1 is clicked.
Thanks