Search
 
SCRIPT & CODE EXAMPLE
 

HTML

javascript inline onclick get event

<div onclick="doSomething(event,this)"></div>
<script>
     function doSomething(e,el){
         e = e || window.event;
         console.log(e); //will be the event
         console.log(el); //we be the dom element 
     }
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: meta redirect 
Html :: soup to html file 
Html :: select placeholder 
Html :: textarea html break line 
Html :: iframe center 
Html :: set an image half its original size css 
Html :: tailwind input 
Html :: embed recaptcha in html 
Html :: html sample code 
Html :: embed html 
Html :: html scale svgö 
Html :: h1 
Html :: content ai writer 
Html :: refused to connect iframe php 
Html :: add subject to mailto 
Html :: row merge 
Html :: tailwind flex shrink 
Html :: html redirect after alert 
Html :: bootstrap alert 
Html :: html a href tooltip 
Html :: select required 
Html :: range html 
Html :: ios viewport cover 
Html :: class required bootstrap 3 
Html :: vuejs v-for array index 
Html :: smooth scroll button by element id 
Html :: html image size 50 percent 
Html :: start a video at a certain time and end time html 
Html :: html font style 
Html :: show/hide password html 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =