I'm working on a school project, and I need a way to link my JavaScript (file: script.js) to an html5 button. I am using repl.it for the project. Somebody please help me!
You do know that a browser and notepad work, if you don't program in PHP, and are free. Also free is notepad++ and VScode for editors?
Three ways to run JS from a button. But for beginners I'd suggest the onclick attribute. Lets say your JS code is in a function named myJavaScript. Then the button attr. would be onclick="myJavaScript()"
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.