{"id":7789,"date":"2021-08-12T08:54:03","date_gmt":"2021-08-12T08:54:03","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=7789"},"modified":"2022-04-13T16:30:45","modified_gmt":"2022-04-13T16:30:45","slug":"what-is-event-in-javascript","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/","title":{"rendered":"What is Event in Javascript?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>What is Event<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The actions to which JavaScript can respond are called Events. An Event is some notable action to which a script can respond.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Clicking an element<\/li><li>Submitting a form<\/li><li>Scrolling page<\/li><li>Hovering an element<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Event Handler<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An Event handler is JavaScript code associated with a particular part of the document and a particular event. A handler is executed if and when the given event occurs at the part of the document to which it is associated.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/e4754de5a9adc23a0813c932c72253d4.js\"><\/script>\n\n\n\n<ul class=\"wp-block-list\"><li>onclick<\/li><li>ondblclick<\/li><li>onchange<\/li><li>onblur<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Event Binding with HTML Attribute<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These bindings are element attributes, such as onclick and on change, which can be set equal to JavaScript that is to be executed when the given event occurs at that object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ex: &#8211; &lt;button onclick= \u201calert(\u2018Button Clicked\u2019);\u201d>Click Me&lt;\/button><\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/2ce3c46a579c8c394718546897e617e0.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Event Binding with JavaScript<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When we use this approach we can add or remove handlers dynamically as well as it improves the separation between the structure of the document and its logic and presentation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ex: &#8211;<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/dd9af12b6a04a2da04813c8850644d29.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Event Binding with JavaScript<\/strong><\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/5c645122591e71240a19b316bb6d41f7.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Overwriting Event Handler<\/strong><\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/cb9a750c695bf31f3467de74e6e492d8.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>DOM Event Model<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The DOM 2 Event Model specification describes a standard way to create, capture, handle and cancel event in a tree like structure such as an XHTML document\u2019s object hierarchy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Phases<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Capture Phase<\/li><li>Target Phase<\/li><li>Bubbling Phase<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>addEventListener ( )<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This method is introduced by DOM2, used to engage an event handler in a page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax:-<br>Object.addEventListener(event, handler, capturePhase);<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Where,<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Object is the node to which the listener is to be bound.<\/li><li>Event is a string indicating the type of event.<\/li><li>Handler is the function that should be called when the event occurs.<\/li><li>capturePhase is a Boolean indicating whether to use Bubbling (false) or Capture (true). This is optional. If you omit there is false by default.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ex:-<\/strong><br><strong>btn.addEventListener(\u201cclick\u201d, show, false);<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why we should use addEventListener ( ) ?<\/strong><\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/d99424b7ac9c5546dabcb550f38da91e.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why we should use addEventListener ( )<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>It allows you to bind multiple handlers to an object for the same event.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>It enables you finer-grained control of the phase when the listener is activated (Capture or Bubbling).<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>It works on any DOM element, not just HTML elements.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>removeEventListener ( )<\/strong><\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/d9914476885c0f3c9f49b9f3d5a71409.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>DOM Event Flow\/ Event Propagation<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The DOM 2 Event Model specification describes a standard way to create, capture, handle and cancel event in a tree like structure such as an XHTML document\u2019s object hierarchy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Phases<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Capture Phase<\/li><li>Target Phase<\/li><li>Bubbling Phase<\/li><\/ul>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/3479fa76d82586b7e82af6e524b065c3.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Event Object<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">DOM events pass an Event object as an argument to handlers. This object contains extra information about the event that occurred.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ex:- a<strong>ddEventListener(\u201cclick\u201d, function(e) { });<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Event Methods<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>stopPropagation() &#8211;\u00a0 Prevents further propagation of the current event in the capturing and bubbling phases.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">     <strong>Syntax:- e.stopPropagation();<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>stopImmediatePropagation() &#8211; Prevents other listeners of the same event from being called.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">     <strong>Syntax:- e.stopImmediatePropagation();<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>preventDefault()\u00a0 &#8211; The Event interface&#8217;s preventDefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">     <strong>Syntax:- e.preventDefault();<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Mouse Event<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>mousedown \u2013 It fires when mouse button is pressed down.<\/li><li>mouseup \u2013 It fires when the mouse button is released.<\/li><li>click \u2013 It fires when something is clicked. mousedown, mouseup and click events fires in sequence.<\/li><li>dblclick \u2013 It fires when something is clicked twice in rapid succession. mousedown, mouseup, click, mousedown, mouseup, click, and dblclick events fires in sequence.<\/li><li>mouseenter \u2013 It fires when a mouse starts to hover over some element. NO bubble.<\/li><li>mouseleave \u2013 It fires when a mouse exits while hovering over some element. No bubble.<\/li><li>mouseover \u2013 It fires when mouse is hovering over some element.<\/li><li>mouseout \u2013 It fires when mouse leaves from hovering over some element.<\/li><li>mousemove \u2013 It fires when the mouse moves.<\/li><li>contextmenu \u2013 It fires when mouse right button is clicked.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Focus Event<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>focus \u2013 It fires when an element gains focus, such as selecting a form field. No Bubble<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>blur \u2013 It fires when element loses focus, such as moving away from a form field. No Bubble<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>focusin \u2013 It fires just as an element is about to gain focus.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>focusout \u2013 It fires just as an element loses focus and just before the blur event.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Event<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>keydown \u2013 It fires as a key is pressed down.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>keypress \u2013 It fires after a key is pressed down (after keydown). It only works with printable characters.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>keyup \u2013 It fires as the key is released.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>What is Event The actions to which JavaScript can respond are called Events. An Event is some notable action to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[16],"tags":[2679,5725,4459,5095],"class_list":["post-7789","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-attributes","tag-events","tag-html","tag-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Event in Javascript? - scmGalaxy<\/title>\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.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Event in Javascript? - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"What is Event The actions to which JavaScript can respond are called Events. An Event is some notable action to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-12T08:54:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-13T16:30:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/08\/what-is-event-in-javascript.png\" \/>\n\t<meta property=\"og:image:width\" content=\"615\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"rajeshkumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rajeshkumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/\"},\"author\":{\"name\":\"rajeshkumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"headline\":\"What is Event in Javascript?\",\"datePublished\":\"2021-08-12T08:54:03+00:00\",\"dateModified\":\"2022-04-13T16:30:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/\"},\"wordCount\":720,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/what-is-event-in-javascript.png\",\"keywords\":[\"Attributes\",\"events\",\"HTML\",\"Javascript\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/\",\"name\":\"What is Event in Javascript? - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/what-is-event-in-javascript.png\",\"datePublished\":\"2021-08-12T08:54:03+00:00\",\"dateModified\":\"2022-04-13T16:30:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/what-is-event-in-javascript.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/what-is-event-in-javascript.png\",\"width\":615,\"height\":350},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/what-is-event-in-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Event in Javascript?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\",\"name\":\"rajeshkumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"caption\":\"rajeshkumar\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/rajeshkumar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Event in Javascript? - scmGalaxy","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.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"What is Event in Javascript? - scmGalaxy","og_description":"What is Event The actions to which JavaScript can respond are called Events. An Event is some notable action to [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/","og_site_name":"scmGalaxy","article_published_time":"2021-08-12T08:54:03+00:00","article_modified_time":"2022-04-13T16:30:45+00:00","og_image":[{"width":615,"height":350,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/08\/what-is-event-in-javascript.png","type":"image\/png"}],"author":"rajeshkumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rajeshkumar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/"},"author":{"name":"rajeshkumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"headline":"What is Event in Javascript?","datePublished":"2021-08-12T08:54:03+00:00","dateModified":"2022-04-13T16:30:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/"},"wordCount":720,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/08\/what-is-event-in-javascript.png","keywords":["Attributes","events","HTML","Javascript"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/","name":"What is Event in Javascript? - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/08\/what-is-event-in-javascript.png","datePublished":"2021-08-12T08:54:03+00:00","dateModified":"2022-04-13T16:30:45+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/08\/what-is-event-in-javascript.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/08\/what-is-event-in-javascript.png","width":615,"height":350},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/what-is-event-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"What is Event in Javascript?"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361","name":"rajeshkumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","caption":"rajeshkumar"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/rajeshkumar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/7789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=7789"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/7789\/revisions"}],"predecessor-version":[{"id":7815,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/7789\/revisions\/7815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/7814"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=7789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=7789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=7789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}