Is it possible to hide a question until media finishes playing? | XM Community
Question

Is it possible to hide a question until media finishes playing?

  • 15 January 2020
  • 1 reply
  • 8 views

I have embedded audio that is set by JavaScript do the following:
1-hide next button until it is finished playing
2-hide media player after audio finishes playing

But, I can't seem to be able to hide the next question until the audio finishes playing. Can this be solved with JavaScript code? And if so, how can this be accomplished?

Thank you!

1 reply

I assume this next question is on the same page?
You just need to know the element ID of the thing you want to hide (easiest way to find this is to "inspect" the web page in preview mode). Then add this line to your javascript function.
document.getElementById("elementid").style.display = "none";
And to show it use style.display = "block"; or whatever it was originally.

You can also use embedded fields to set variables that can be accessed from a different question but is unnecessary if the questions are on the same page.

Leave a Reply