I need a button "See a cat" which sends the user to the descriptive "question" with a dog picture. I would be glad to post a minimal working example but after two days I am still clueless.
How to add a custom button between "Previous" and "Next"?
In your question, add a button with some id.
Use JS to move this element to the "Buttons" container:
document.querySelector("#Buttons").insert(document.querySelector("#cat_button")
Hide the dog question onload using JS:
this.questionContainer.hide()
Assign an onclick attribute to the cat button to toggle visibility of the questions:
document.querySelector("#cat_button").onclick = function () {
document.querySelectorAll("[id^=QID]:not(.Separator)").forEach((quest) => {
if (quest.style.display == "none") quest.show();
else quest.hide();
});
};
Thanks, though I would need to find a more straightforward solution as I would use the same code to get back to the question.
Leave a Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.