Use Javascript to Display Descriptive Text Only 2 Seconds | XM Community
Skip to main content
I am looking for Javascript code to have a descriptive text question disappear after two seconds. Respondents are briefly shown a message "We ask that you take a few moments to review this image before you will be able to continue" before then seeing an image.



I would like the message to disappear after 2 seconds at the same time as the image appears. I already know how to delay the image by 2 seconds using the Javascript code below.



Qualtrics.SurveyEngine.addOnReady(function()

{

var delayTime = 2000 //This is the time of delay

var that = this;

setTimeout(function(){that.getQuestionContainer().show()}, delayTime);



});



Any ideas on how to hide the text after two seconds? I couldn't find the solution among previously asked questions; any help would be greatly appreciated!
Hi @tioh1001 ,



You can use "Timing" question to hide the text after 2 seconds.



Thanks,

Bhushan
@tioh1001,



Do it the exact same way you show something after 2 seconds except use the .hide() function instead of the .show() function.

Leave a Reply