Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to prevent event capturing in javascript

how to prevent event button click capturing to tag/div/icon
easiest way OPTION 1 with CSS:
button > * {
  pointer-events: none;
}

OPTION 2 with javascript:
use e.currentTarget.children ;

OPTION 3 with Javascript:
use e.target.closest('selector') to locate the child, not e.currentTarget;

Comment

PREVIOUS NEXT
Code Example
Javascript :: express receive post 
Javascript :: es6 iife 
Javascript :: javascript arrow functions default parameter 
Javascript :: nested object javascript 
Javascript :: upload form with doc type in ajax 
Javascript :: array to object 
Javascript :: payloadtoolargeerror node js 
Javascript :: javascript get current date format dd mm yyyy hh mm ss 
Javascript :: javascript urlsearchparams to object 
Javascript :: react native keyboard event listener 
Javascript :: sequelize order with include 
Javascript :: Accessing $route.params in VueJS 
Javascript :: random number in javascript between two numbers 
Javascript :: javascript is radio button checked 
Javascript :: push function in javascript 
Javascript :: how to run commands in the command prompt using javascript 
Javascript :: xmlhttprequest 
Javascript :: Radom String in Javascript 
Javascript :: array length javascript 
Javascript :: Group array of strings by first letter 
Javascript :: multiply function javascript 
Javascript :: offsetheight javascript 
Javascript :: ajax open new tab with post 
Javascript :: new date parameters javascript 
Javascript :: .textcontent in javascript 
Javascript :: react select npm 
Javascript :: node js get list of all names of object array 
Javascript :: export all javascript 
Javascript :: string json to class c# 
Javascript :: get window width 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =