{"id":7608,"date":"2013-01-28T12:14:10","date_gmt":"2013-01-28T12:14:10","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=7608"},"modified":"2024-04-12T14:17:06","modified_gmt":"2024-04-12T08:47:06","slug":"capture-and-release-events","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/","title":{"rendered":"Capture and release events"},"content":{"rendered":"<p><strong>Event Capturing<\/strong> &#8211; When someone clicks on a button, the onClick event handler of this button is being called. Sometimes to handle certain types of events of the window, document or layer object object, the steps for setting up event capturing are<\/p>\n<p>1) <u>Set up the window to capture all Click events<\/u> &#8211; The event capturing works a little bit differently between the browsers. Use the method captureEvent() for this as<\/p>\n<p>window.captureEvents(Event.CLICK);<\/p>\n<p>To capture several events separate them through a &#8216;|&#8217; as<\/p>\n<p>window.captureEvents(Event.CLICK | Event.MOVE);<\/p>\n<p>Event Capturing in Internet Explorer:<\/p>\n<p>document.onclick = MyFunction();<\/p>\n<p>2) <u>Define a function that handles the event<\/u> &#8211; The argument &#8216;e&#8217; is the event object for the event. In IE no need to pass the &#8220;e&#8221; value.<\/p>\n<p>function MyFunction(e) {<\/p>\n<p>alert(&#8216;Test&#8217;); }<\/p>\n<p>3) <u>Define the function as the window&#8217;s event handler for that event<\/u> &#8211; The example tells to the browser to call MyFunction() when a Click event occurs.<\/p>\n<p>window.onclick= MyFunction();<\/p>\n<p>Event release &#8211; The releaseEvents() method releases all previously captured events. These events can be captured with the Window.captureEvents() method. It&#8217;s syntax is 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\">window.releaseEvents(event)<p><\/p>\n<p>or<\/p>\n<p>window.releaseEvents(event1 | event2 | eventN)<\/p>\n<\/td>\n<td width=\"410\">window.releaseEvents(onclick)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\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>Event Capturing &#8211; When someone clicks on a button, the onClick event handler of this button is being called. Sometimes to handle certain types of events of the window, document or layer object object, the steps for setting up event capturing are 1) Set up the window to capture all Click events &#8211; The event&#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":[2812],"class_list":["post-7608","page","type-page","status-publish","hentry","category-dhtml-and-javascript","tag-capture-and-release-events"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Capture and release events - Tutorial<\/title>\n<meta name=\"description\" content=\"Capture and release events. 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\/capture-and-release-events\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Capture and release events - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Capture and release events. 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\/capture-and-release-events\/\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/\",\"name\":\"Capture and release events - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2013-01-28T12:14:10+00:00\",\"dateModified\":\"2024-04-12T08:47:06+00:00\",\"description\":\"Capture and release events. 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\/capture-and-release-events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Capture and release events\"}]},{\"@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":"Capture and release events - Tutorial","description":"Capture and release events. 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\/capture-and-release-events\/","og_locale":"en_US","og_type":"article","og_title":"Capture and release events - Tutorial","og_description":"Capture and release events. 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\/capture-and-release-events\/","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":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/","name":"Capture and release events - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2013-01-28T12:14:10+00:00","dateModified":"2024-04-12T08:47:06+00:00","description":"Capture and release events. 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\/capture-and-release-events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/capture-and-release-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Capture and release events"}]},{"@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\/7608","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=7608"}],"version-history":[{"count":7,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7608\/revisions"}],"predecessor-version":[{"id":121676,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/7608\/revisions\/121676"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=7608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=7608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=7608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}