Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js events

Events:

Mouse:
onclick
The event occurs when the user clicks on an element
oncontextmenu
User right-clicks on an element to open a context menu
ondblclick
The user double-clicks on an element
onmousedown
User presses a mouse button over an element
onmouseenter
The pointer moves onto an element
onmouseleave
Pointer moves out of an element
onmousemove
The pointer is moving while it is over an element
onmouseover
When the pointer is moved onto an element or one of its children
onmouseout
User moves the mouse pointer out of an element or one of its children
onmouseup
The user releases a mouse button while over an element

Keyboard:
onkeydown
When the user is pressing a key down
onkeypress
The moment the user starts pressing a key
onkeyup
The user releases a key

Frame:
onabort
The loading of a media is aborted
onbeforeunload
Event occurs before the document is about to be unloaded
onerror
An error occurs while loading an external file
onhashchange
There have been changes to the anchor part of a URL
onload
When an object has loaded
onpagehide
The user navigates away from a webpage
onpageshow
When the user navigates to a webpage
onresize
The document view is resized
onscroll
An element’s scrollbar is being scrolled
onunload
Event occurs when a page has unloaded

Form:
onblur
When an element loses focus
onchange
The content of a form element changes (for <input>, <select>and <textarea>)
onfocus
An element gets focus
onfocusin
When an element is about to get focus
onfocusout
The element is about to lose focus
oninput
User input on an element
oninvalid
An element is invalid
onreset
A form is reset
onsearch
The user writes something in a search field (for <input="search">)
onselect
The user selects some text (for <input> and <textarea>)
onsubmit
A form is submitted

Drag:
ondrag
An element is dragged
ondragend
The user has finished dragging the element
ondragenter
The dragged element enters a drop target
ondragleave
A dragged element leaves the drop target
ondragover
The dragged element is on top of the drop target
ondragstart
User starts to drag an element
ondrop
Dragged element is dropped on the drop target

Clipboard:
oncopy
User copies the content of an element
oncut
The user cuts an element’s content
onpaste
A user pastes content in an element

Media:
onabort
Media loading is aborted
oncanplay
The browser can start playing media (e.g. a file has buffered enough)
oncanplaythrough
When browser can play through media without stopping
ondurationchange
The duration of the media changes
onended
The media has reached its end
onerror
Happens when an error occurs while loading an external file
onloadeddata
Media data is loaded
onloadedmetadata
Meta Metadata (like dimensions and duration) are loaded
onloadstart
Browser starts looking for specified media
onpause
Media is paused either by the user or automatically
onplay
The media has been started or is no longer paused
onplaying
Media is playing after having been paused or stopped for buffering
onprogress
Browser is in the process of downloading the media
onratechange
The playing speed of the media changes
onseeked
User is finished moving/skipping to a new position in the media
onseeking
The user starts moving/skipping
onstalled
The browser is trying to load the media but it is not available
onsuspend
Browser is intentionally not loading media
ontimeupdate
The playing position has changed (e.g. because of fast forward)
onvolumechange
Media volume has changed (including mute)
onwaiting
Media paused but expected to resume (for example, buffering)
Animation
animationend
A CSS animation is complete
animationiteration
CSS animation is repeated
animationstart
CSS animation has started

Other:
transitionend
Fired when a CSS transition has completed
onmessage
A message is received through the event source
onoffline
Browser starts to work offline
ononline
The browser starts to work online
onpopstate
When the window’s history changes
onshow
A <menu> element is shown as a context menu
onstorage
A Web Storage area is updated
ontoggle
The user opens or closes the <details> element
onwheel
Mouse wheel rolls up or down over an element
ontouchcancel
Screen touch is interrupted
ontouchend
User finger is removed from a touch screen
ontouchmove
A finger is dragged across the screen
ontouchstart
Finger is placed on touch screen
Comment

javascript events

document.querySelector('html').onclick = function() {
    alert('Ouch! Stop poking me!');
}
Comment

events in javascript

Events are things browser or user do it like click,scroll,press keyboard.
const button =document.querySelector('#submit)
 //Click,Scroll,Resizing the browser
 button.addEventListener('click', function(){
console.log('New Item added'); //when button with id #submit click it console.log
})
Comment

events in javascript

//this is an event detector for a mouseclick with Jquery
$('#id').on('click',function(){
    yourFunction(args);
});
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

events js

import { EventEmitter } from "node:events";
/**
 * add "type":"module" in package.json
 */

class MyEmitter extends EventEmitter {}

const myEvent = new MyEmitter();

myEvent.on("event", () => {
  console.log("an event occurred!");
});

myEvent.emit("event");
Comment

javascripts events

let array_1 = [1, 2, 3, 4, 5, 6];
Comment

PREVIOUS NEXT
Code Example
Javascript :: hello world in react 
Javascript :: getmonth javascript 
Javascript :: custom hook react 
Javascript :: react native get screen height and width 
Javascript :: javascript set size 
Javascript :: online convert python to javascript 
Javascript :: how to add prefix to a string in javascript 
Javascript :: pimcore 
Javascript :: javascript neue zeilekill 
Javascript :: remove equal objects in list of json js 
Javascript :: useThrottle 
Javascript :: Finding palindrome using for loop 
Javascript :: JavaScript, numbers are primitive data types 
Javascript :: return number less than in 250 
Javascript :: xhr.upload 
Javascript :: JavaScript Comparison and Logical Operators 
Javascript :: ejs split string 
Javascript :: Knockout js custom bindings 
Javascript :: js regex find newlines 
Javascript :: Warning: Problem validating app.json: Unable to perform cache refresh for 
Javascript :: phaser place on rectangle 
Javascript :: phaser play animation after delay 
Javascript :: Exercice âge JavaScript 
Javascript :: angular reactive forms bootstrap 4 
Javascript :: show a variable value in an html webpage using dom javascript 
Javascript :: Self Invoking Function ($()) That Can Be Reused 
Javascript :: react native countdown 
Javascript :: e.target.value with number 
Javascript :: javascript learning 
Javascript :: parse query url javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =