set onclick javascript
<button id="myBtn">Try it</button>
<p id="demo"></p>
<script>
document.getElementById("myBtn").onclick=function(){displayDate()};
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
Also in JavaScript:
- random alphabet javascript
- javascript import
- array remove empty entrys js
- get year javascript copyright
- multiple case switch javascript
- extjs clone object
- express js post request body
- firebase storage javascript delete document
- node js post multipart/form-data
- javascript find document body
- jquery siblings
- Enclose in Brackets
- mongoose find by and delete
- jquery if checkbox is checked
- check if something is a letter in js
- create server and connect to db and frontend
- get the id of a div in jquery
- javascript Count the frequency of a value in an array
- python save list to json
- how to add alternate image in img tag in react
- how to validate input type=date in javascript
- javascript hasownproperty
- how to use the onload event n vue js
- You are running Node 8.10.0. Create React App requires Node 10 or higher. Please update your version of Node.