Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: nodejs open default browser on specific web page 
Javascript :: 0.1 + 0.2 javascript 
Javascript :: android resource linking failed react native image crop picker 
Javascript :: discord javascript error cannot find module 
Javascript :: sorting array from highest to lowest javascript 
Javascript :: ReferenceError: fetch is not defined 
Javascript :: add event listener on modal close 
Javascript :: how to let a function execute after 5 seconds javascript 
Javascript :: javascript date set weeks 
Javascript :: open json file r 
Javascript :: take input from input array field jquery 
Javascript :: react router get host origin js 
Javascript :: get position of element 
Javascript :: regx get only domain name from url 
Javascript :: map over object javascript 
Javascript :: Find channel discord js 
Javascript :: js create array with n elements 
Javascript :: string iterate in js 
Javascript :: onclick go to url 
Javascript :: unique array javascript es6 Map 
Javascript :: jquery cancel ajax request on click 
Javascript :: javascript play sound onclick 
Javascript :: javascript convert string to number 
Javascript :: angular get current time 
Javascript :: how to find out if mongoose is connected or not 
Javascript :: how to copy text in react 
Javascript :: detect fullscreen mode 
Javascript :: js foreach determine if last 
Javascript :: jquery grid disable sorting 
Javascript :: fibonacci series in javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =