Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dom event

/*
  DOM [Events]
  - Use Events On HTML
  - Use Events On JS
  --- onclick
  --- oncontextmenu
  --- onmouseenter
  --- onmouseleave

  --- onload
  --- onscroll
  --- onresize

  --- onfocus
  --- onblur
  --- onsubmit
*/

let myBtn = document.getElementById("btn");

myBtn.onmouseleave = function () {
  console.log("Clicked");
};

window.onresize = function () {
  console.log("Scroll");
};
Comment

javascript event

// An event is triggered when a user clicks on the #button element,
// which then sets the #button element's background-color to blue. 
$('#button').on('click', event => {
  $(event.currentTarget).css('background-color', 'blue');  
});
Comment

JavaScript HTML DOM Event

<!DOCTYPE html>
<html>
<body>

<h1 onclick="this.innerHTML = 'Ooops!'">Click on this text!</h1>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: array permutation 
Javascript :: console.log 
Javascript :: how to set css in hbs in express 
Javascript :: comment in js 
Javascript :: jsp date 
Javascript :: react strict mode 
Javascript :: array destructuring 
Javascript :: Node.JS mongodb create database 
Javascript :: jquery validation stop form submit 
Javascript :: how to edit message discord.js 
Javascript :: js reverse string 
Javascript :: js class private 
Javascript :: navbar route with params vue 
Javascript :: axios set request header 
Javascript :: typeof in js 
Javascript :: Uncaught (in promise) Error: Redirected when going from "/login" to "/" via a navigation guard. 
Javascript :: module.exports multiple functions 
Javascript :: javascript add item to list 
Javascript :: jquery validation from data 
Javascript :: subset in js 
Javascript :: isotope js 
Javascript :: simple node rest 
Javascript :: concat multiple arrays in javascript 
Javascript :: ajax loader 
Javascript :: react tailwind loading 
Javascript :: toast success 
Javascript :: netlify page not found on refresh vuejs vue-router 
Javascript :: how can you set an environment variable in node 
Javascript :: ng select2 angular dropdown 
Javascript :: remove object from array of object 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =