{"id":7606,"date":"2013-01-28T12:13:07","date_gmt":"2013-01-28T12:13:07","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=7606"},"modified":"2024-04-12T14:17:06","modified_gmt":"2024-04-12T08:47:06","slug":"event-objects-and-handlers","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/","title":{"rendered":"Event Objects and handlers"},"content":{"rendered":"<p>Client-side JavaScript programs use an asynchronous event-driven programming model. An object is a construct with properties that are JavaScript variables or other objects. An object also has functions associated with it that are known as the object&#8217;s methods.<\/p>\n<p>The event object is a browser object used to get information about a particular event specified. Using event object, user can access information about event happenings. The difference between event object and Event object is such that the latter gives constants that can be used to identify events, while the former is used to get information about events. JavaScript events are items that transpire based on an action. A document event is the loading of an HTML document. A form event is the clicking on a button. Events are objects with properties.<\/p>\n<ul>\n<li>x -Mouse x coordinate when the event happened.<\/li>\n<li>y -Mouse y coordinate when the event happened.<\/li>\n<\/ul>\n<p>JavaScript defines five types of events which are form, image, image map, link, and window events.<\/p>\n<p>Events are associated with HTML tags. The definitions of the events described below are as follows:<\/p>\n<ul>\n<li>abort &#8211; A user action caused an abort of an image or document load.<\/li>\n<li>blur &#8211; A frame set, document, or form object such as a text field loses the focus for input.<\/li>\n<li>click &#8211; Happens when a link or image map is clicked on<\/li>\n<li>change &#8211; Happens when a form field is changed by the user and it loses the focus.<\/li>\n<li>error &#8211; An error happened loading a image or document.<\/li>\n<li>focus &#8211; A frame set, document, or form object such as a text field gets the focus for input.<\/li>\n<li>load &#8211; The event happens when an image or HTML page has completed the load process in the browser.<\/li>\n<li>mouseOut &#8211; The event happens when the mouse is moved from on top of a link or image map<\/li>\n<li>mouseOver &#8211; The event happens when the mouse is placed on a link or image map.<\/li>\n<li>reset &#8211; The user reset the object which is usually a form.<\/li>\n<li>submit &#8211; The user submitted an object which is usually a form.<\/li>\n<li>unload &#8211; The object such as a framesed or HTML document was exited by the user.<\/li>\n<\/ul>\n<p><strong>Event Handler<\/strong> &#8211; Applications register their event handler functions with the web browser, specifying an event type and an event target. When an event of the specified type occurs on the specified target, the browser invokes the handler. Event objects are passed as an argument to the event handler function. Event handlers are linked to HTML tags as<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"211\"><strong>Syntax<\/strong><\/td>\n<td width=\"410\"><strong>Example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"211\">onEvent = &#8220;Code to handle the event&#8221;<\/td>\n<td width=\"410\">&lt;input type=&#8221;button&#8221; value=&#8221;Click Me!&#8221; onclick=&#8221;window.alert(&#8216;Hi!&#8217;);&#8221; \/&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n<p><a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/dhtml-and-javascript-developer\/\" target=\"_blank\" rel=\"noreferrer noopener\">Back to Tutorial<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Client-side JavaScript programs use an asynchronous event-driven programming model. An object is a construct with properties that are JavaScript variables or other objects. An object also has functions associated with it that are known as the object&#8217;s methods. The event object is a browser object used to get information about a particular event specified. Using&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[3352],"tags":[2811],"class_list":["post-7606","page","type-page","status-publish","hentry","category-dhtml-and-javascript","tag-event-objects-and-handlers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Event Objects and handlers - Tutorial<\/title>\n<meta name=\"description\" content=\"Event Objects and handlers. Govt of India Certification for DHTML and Javascript professionals. Get Certified and improve employability. Certification assesses candidates in DHTML.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Event Objects and handlers - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Event Objects and handlers. Govt of India Certification for DHTML and Javascript professionals. Get Certified and improve employability. Certification assesses candidates in DHTML.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:47:06+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/\",\"name\":\"Event Objects and handlers - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2013-01-28T12:13:07+00:00\",\"dateModified\":\"2024-04-12T08:47:06+00:00\",\"description\":\"Event Objects and handlers. Govt of India Certification for DHTML and Javascript professionals. Get Certified and improve employability. Certification assesses candidates in DHTML.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Event Objects and handlers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Event Objects and handlers - Tutorial","description":"Event Objects and handlers. Govt of India Certification for DHTML and Javascript professionals. Get Certified and improve employability. Certification assesses candidates in DHTML.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/","og_locale":"en_US","og_type":"article","og_title":"Event Objects and handlers - Tutorial","og_description":"Event Objects and handlers. Govt of India Certification for DHTML and Javascript professionals. Get Certified and improve employability. Certification assesses candidates in DHTML.","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:47:06+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/","name":"Event Objects and handlers - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2013-01-28T12:13:07+00:00","dateModified":"2024-04-12T08:47:06+00:00","description":"Event Objects and handlers. Govt of India Certification for DHTML and Javascript professionals. Get Certified and improve employability. Certification assesses candidates in DHTML.","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/event-objects-and-handlers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Event Objects and handlers"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=7606"}],"version-history":[{"count":6,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7606\/revisions"}],"predecessor-version":[{"id":82893,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7606\/revisions\/82893"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=7606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=7606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=7606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}