Javascript – Form and Input Field Events

Javascript – Form and Input Field Events

input – occurs when gets user input change – occurs when the user changes input, select or textarea elements focus – occurs when an element gets focus blur – occurs when an element loses focus select – occurs when the user selects the text inside input and textarea element submit – occurs when a form is submitted Javascript – Form and Input Field Events

Javascript – Form and Input Field Events Read More

Javascript – mouse events

Javascript – mouse events

Events A small list with the most common mouse events. click – occurs when you click on an element dblclick – occurs when you click on an element mousedown – occurs when you press a mouse button down over an element mouseup – occurs when you release a mouse button over an element mousemove – occurs when the pointer is moving while it is over an element mouseenter – occurs when the pointer is moved onto an element mouseleave – occurs when the pointer is moved out of an element…

Javascript – mouse events Read More

Javascript – keyboard events

Javascript – keyboard events

List with keyboard events keydown – triggered when a key is pressed keyup – triggered when a key is released keypress (deprecated) – triggered when a key pressed and releaded List with keyboard event properties keycode – returns the Unicode code key – returns the pressed key in string format code – returns the pressed key in string format. It is totally independent of the keyboard layout shiftkey – returns if Shift key is pressed ctrlkey – returns if Ctrl key is pressed altkey – returns if Alt key is…

Javascript – keyboard events Read More

Javascript – Events

Javascript – Events

You can execute javascript code when an event occurs. To happen this you need to add an event listener. You can add an event listener in Javascript or to an HTML element. Let’s see adding an event listener to an HTML element. Now, in Javascript, you need to get the reference for the button. Now, add the event listener You can also write the callback function as an anonymous function Another method to add the event listener is to add it in HTML using attributes: You can remove an event…

Javascript – Events Read More