Input on click HTML element

8 views
Skip to first unread message

George Crowne

unread,
Apr 16, 2021, 10:05:27 AMApr 16
to Minno.js
Hi All,

Really quick question regarding using an HTML element on click input for a miTime trial.

Here's the code snippet for the input portion of the trial:
input: [
    {handle:'end',on:'click',element: ('<button>START</button>')}
]

I'm trying to simply create a button to progress through the trial. This code snippet works when running the .js file directly, however when accessing it through the .expt.xml file, I get an error that reads:

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

The button created in the code snippet doesn't appear due to the error. Does anyone have any idea how to make this code snippet work when accessing it through the .expt.xml file? Hopefully this is a quick fix.

Thanks in advance!

Elad Zlotnick

unread,
Apr 18, 2021, 1:41:46 PMApr 18
to Minno.js
Hi George,

The reasonable way to do this is by creating a regular stimulus.
You can use html media in order to create the button: https://minnojs.github.io/docs/time/api/media/

Then you can identify the stimulus for the click input by using "stimHandle".
For setting stimHandle see the documentation here: https://minnojs.github.io/docs/time/api/trial/input/#click
And an example here: https://minnojs.github.io/docs/time/examples/input/ (see the third trial example).

best,
Elad
Reply all
Reply to author
Forward
0 new messages