Event.height Stores the height of the window or frame containing the object connected with the event. Returns an array of URLs of dropped objects. There are a number of properties associated with the Event object that can be queried to provide additional information about the event: Event.data Used by the onDragDrop event.
The Event object is created automatically whenever an event occurs. All element names and attributes must be lowercase in XHTML. To use an event handler, you usually place the event handler name within the HTML tag of the object you want to work with, followed by =" SomeJavaScriptCode", where SomeJavaScriptCode is the JavaScript you would like to execute when the event occurs.Īlthough the original JavaScript event handler name contains capital letters ( "onClick"), you should use all lowercase in the HTML itself ( "onclick") if you want your markup to follow the XHTML specification (which we do!). The user clicks the form’s Submit button. The user resizes the browser window or frame. The user moves the browser window or frame. The user moves the mouse over the object. The user moves the mouse away from the object. by clicking on it or pressing the TAB key). The data in the form element is changed by the user.īutton, Document, Checkbox, Link, Radio, Reset, SubmitĪn icon is dragged and dropped into the browser. by clicking outside it or pressing the TAB key).
Here’s a list of all the event handlers in JavaScript, along with the objects they apply to and the events that trigger them: Event handlerīutton, Checkbox, FileUpload, Layer, Password, Radio, Reset, Select, Submit, Text, TextArea, Window All the event handlers in JavaScript start with the word on, and each event handler deals with a certain type of event.
#USE EVENT KEY OUTSIDE KEYUP FUNCTION JAVASCRIPT CODE#
To allow you to run your bits of code when these events occur, JavaScript provides us with event handlers.
By writing code that reacts to events, you can make your web pages much more interactive!Įvents allow you to write JavaScript code that reacts to certain situations. In this tutorial we’re going to take a look at a very handy feature of JavaScript called events.