diff --git a/docs/demos/jspsych-html-button-response-demo2.html b/docs/demos/jspsych-html-button-response-demo2.html new file mode 100644 index 0000000000..66af48b512 --- /dev/null +++ b/docs/demos/jspsych-html-button-response-demo2.html @@ -0,0 +1,46 @@ + + +
+ + + + + + + + + + + diff --git a/docs/plugins/html-button-response.md b/docs/plugins/html-button-response.md index 9619c73881..8aba3678bd 100644 --- a/docs/plugins/html-button-response.md +++ b/docs/plugins/html-button-response.md @@ -74,4 +74,33 @@ import htmlButtonResponse from '@jspsych/plugin-html-button-response'; Open demo in new tab +???+ example "Using `button_html` to generate custom buttons" + === "Code" + ```javascript + const trial = { + type: jsPsychHtmlButtonResponse, + stimulus: `What color should the gray block be?
", + button_html: (choice) => `` + }; + ``` + + === "Demo" +