how to call a function with a button in javascript
<script>
function myFunction()
{
document.write("<h1>HELLO</h1>")
}
</script>
<button onclick="myFunction()">Click</button><script>
function myFunction() {
alert("ALERT");
}
</script>
<button onclick="myFunction">Click</button>execute javascript function on button click
Also in JavaScript:
- how to make a javascript game
- Getting Nan when calculate two date js
- toggle jquery remove others
- js return undefined on ReferenceError
- hmac_sha256 node
- Error: Cannot find module 'ejs'
- react native image not working ios 14
- Uncaught Error: spawn node C:\Users\Leonl\Desktop\rpi-nano-server\electron\express\server.js ENOENT electron
- get current time epoch javascript
- less than equal to in javascript
- array con javascript
- settimeout node js
- add role to channel discord.js
- local storage javascript object
- on reload js
- convert javascript date into excel date
- get width of a dom element js
- how to use axios in vue
- how to swap two images in javascript
- uninstall node js from mac
- on hover add class on children jquery
- javascript function with array parameter
- create multidimensional array javascript for loop
- js return a promise