Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

events onclick

document.getElementById("myBtn").onclick=function(){displayDate()};

function displayDate()
{
    document.getElementById("demo").innerHTML=Date();
}
//------------
<button onclick="myFunction()">Click me</button>
<p id="demo" onclick="myFunction()">Click me to change my text color.</p>
//------------
<input value="Click" onclick="alert('Click')" type="button">
//------------
  document.getElementById(id).setAttribute('onclick','myFunction()')

Comment

PREVIOUS NEXT
Code Example
Javascript :: lodash filter array objects 
Javascript :: check if a string matches a regex javascript 
Javascript :: Show and Hide Content jQuery 
Javascript :: sequelize manual model/index.js 
Javascript :: redirect to dashboard after login in vue 
Javascript :: get number of digits in a number 
Javascript :: js promise api 
Javascript :: 1 line password strength checker jquery 
Javascript :: query parameters 
Javascript :: show and hide element in react 
Javascript :: jquery get name value method 
Javascript :: find multiples of a number 
Javascript :: for loop react 
Javascript :: @input in angular 
Javascript :: how to display words from an array in a box in javascript 
Javascript :: how to use youtube api javascript 
Javascript :: round down html 
Javascript :: can we fine a key with help of value in array of objects javascript 
Javascript :: how to do when enter is pressed javascript do smething 
Javascript :: vbscript popup message box with timer 
Javascript :: onpress not working when textinput isfocused in react native 
Javascript :: javascript alert html 
Javascript :: how to delete an element from an array 
Javascript :: https://jsonplaceholder.typicode.com/albums/1 
Javascript :: how to check if a browser is supported 
Javascript :: express cors policy 
Javascript :: javascript and json 
Javascript :: how to send headers using swr 
Javascript :: javascript round down to 2 decimal places 
Javascript :: getinitialprops to a hoc in next js 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =