I pasted the HTML and JavaScript code into a Stack Snippet but I can't run it. N.B. I'm calling my JavaScript functions In the HTML code using tags. How can I make it work?
EDIT: As suggested, I put all the script code into the JavaScript box and it works. The problem was that the Stack snippet fills the JS code at the end of the HTML file.