Hello! I start by saying that I have no experience at all with javascript and Html, so I would really benefit from your help to overcome the following problem.
On some of the pages of my surveys, I should display a box that the user can toggle in order to get a suggestion.
Adopting the code that I have already found here on the forum, I already accomplished doing this (https://community.qualtrics.com/XMcommunity/discussion/11284/button-to-toggle-and-display-more-text).
Java script:
jQuery("#button").click(function() {
jQuery("#infodiv").toggle();
});
HTML:
Problem:
Before showing the actual suggestion and after toggling the button, I would need a sort of "loading" function triggered by clicking on the button. This loading function could be either a loading bar that gradually reaches 100% before showing the suggestion or just a loop that goes from 1 to 100% or a loop that from "Loading" goes "Loading...".
To sum up, the final result should be a button that, when toggled:
1- Shows the loop (that should give the idea of something "loading the suggestion")
2- Shows the suggestion
I hope I was able to explain myself, unfortunately, I am not familiar with coding. I hope you can help me in overcoming this problem