How would I count the amount of times participants pressed a button? | XM Community
Skip to main content

how to get the equivalent of "button counts," perhaps by having people press the button each time a target thoughts goes through their mind for a limited period (e.g., 3 minutes)

Are you referring to a keyboard button or an html button? Either way, you do it with a JS event listener, but they are two different events.


html button
I don't know how to code.


Use a click event. For example:
var count = 0;
jQuery("#myButton").click(function() {
count++;
Qualtrics.SurveyEngine.setEmbeddedData("count", count);
}); 


Actually, I haven't figured out how to make the button, yet, so I don't know if it's html or not.


You can create a button using HTML view of question :


See "How would I create a button to go with this question?"


Leave a Reply