Hi,
on https://theme.co/docs/toggleable#programmatically it’s described how a modal can be openend programatically. I’ve tried to implement that, but so far, it isn’t working.
The modal settings:
The Javascript:
var button = document.getElementById("code-check"); var code_input = document.getElementById("code-input"); var code_correct = 629; button.onclick = function(){ var cur_value = code_input.value; if(cur_value == code_correct){ alert("klopt"); window.xToggleUpdate('modal-code-correct', true) } }
The alert is firing, the modal isn’t. What am I missing here?