Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How to set a duration of an inline_html

Hello,

I am trying to set a duration of 1750 ms on an inline_html.

I would like to display a white text "Såg du den här bilden nyss?" in the center of a black screen for 1750 ms and then it should go to the next step without any input. It should also change dynamically according to the screen size, that is why I am doing it in HTML and not on sketchpad.

If you have any alternative solution I am also interested.

Thank you in advance for your answer.

Comments

  • Hi @Sara_MC ,

    The inline_html item is essentially a regular HTML page and thus allows you to embed JavaScript. Through this route you can use setTimeout() to programmatically click on a submit button after a certain interval. Below you can see how this works, though you will need to modify it for your purpose:

    <input type='text' name='text_response'>
    <input type='submit' value='ok' id='submit-button'>
    <script>
    // The () => { function body } notation is a so-called arrow function
    setTimeout(() => document.getElementById('submit-button').click(), 1750)
    </script>
    

    Hope this helps!

    — Sebastiaan

Sign In or Register to comment.