Professional Documents
Culture Documents
Commonly Used HTML Events
Commonly Used HTML Events
Mouse events
● onclick - triggers on the single click of the mouse.
● onwheel - triggers when the wheel of the mouse moves over an element.
Keyboard events
● onkeydown - triggers when a key is being pressed.
Window events
● onload - triggers when a window is completely loaded.
Form events
● onchange - triggers when the value of an element is changed.
Drag events
● ondrag - triggers when an element is dragged.
Summary
● HTML events make something happens. They are used just like other attributes.
● Different types of HTML events are mouse, keyboard, drag, window, media, and form events.
● The value of an event is written inside the quotes. What will happens next depends on the value.
● Generally, functions are triggered using HTML events because they can have multiple lines of codes inside them.