Giving iframe automatic focus | XM Community
Skip to main content

Hello!

At the moment I have a game of tetris running in a couple of my experiments. It’s coded using java and hosted on github. I then use the </> function on Qualtrics to create an iframe.

One issue however is that users have to ‘click’ into the iframe in order to use the controls for the game. Otherwise up/down controls the scroll bars on the qualtrics website, or don’t do anything at all, until the game frame itself is clicked.

Is there anyway I can make the iframe the immediate focus, rather than the qualtrics website?

Would love any help!

I usually just add a start game button for these. However you can look at a few options here: https://stackoverflow.com/questions/369026/setting-focus-to-iframe-contents


Leave a Reply