Forum Discussion
Set Text Input Focus Via JavaScript
Yes, but you have to communicate with the web object by sending messages between it and Storyline. The index.html inside the web object listens for the message, and then acts accordingly.
If you look at this post, you can see how it works (it is communicating between a SL slide and a web object).
How to Communicate Between Storyline and a mySQL Database | Articulate - Community
Focus on the In Storyline and On the Web Server - index.html portions. It uses XMLHttpRequest.
Note that this example talks to a web object linking to content on another server. In this cicumstance, this is the approach to use.
If you have a web object that is hosted from within your project (e.g., the index.html is local), then you can communicate directly between the iframe contents and SL in a similar way to what you were attempting. Using the data-acc-text selector does not work however.
In both cases, you need to use something like let iframe = window.frames[0] to locate the first iframe on the slide. If there are more than one, specify the correct frame.
Then...
iframe will refer to the window environment within the selected iframe (the global space).
iframe.document will refer to the DOM structure of the index.html