Skip to content
Discussion options

You must be logged in to vote

Hi @marco2gandolfo,

One thing you could do is use the display_element parameter in jsPsych.init({...}) to have jsPsych run the experiment in a DOM element on the page, and then you could have a button on the page that wouldn't be part of the experiment.

<body>
	<div id="jspsych-target"></div>
	<button id="restart-btn">Restart the Experiment</button>
</body>
<script>
	jsPsych.init({
		display_element: 'jspsych-target'
	})
</script>

As far as implementing the button itself, I think that depends on what exactly you want the restart to mean. Is it just literally reloading the page, or do you want to do something else?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@marco2gandolfo
Comment options

@jodeleeuw
Comment options

@marco2gandolfo
Comment options

Answer selected by jodeleeuw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants