Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get clicked element class in jquery

// HazaaZOOZ - jquery - how to get clicked element class in jquery

  // Example to get Class of Clicked Element using alert

  // Your jquery code
  $(document).on("click", function(event){
      alert(event.target.className);
  })
  
  // Your HTML code
    <button type="button" class="YourFirstClass">First Button</button>
    <input type="button" class="YourSecondClass" value="Second Button">
    <button type="button" class="YourThirdClass">Third Button</button>
    
  // Not forget to add script into the head tag
  <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  
  
    
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript round number to nearest 5 
Javascript :: access to xmlhttprequest at from origin http localhost:3000 has been blocked by cors policy 
Javascript :: jquery remove disabled property from button 
Javascript :: asp.net core 3.1 convert system.string[] to javascript 
Javascript :: js replace characters in a string 
Javascript :: get the value or text from select element using javaScript 
Javascript :: react native how to delete android build 
Javascript :: convert iso 8601 to utc javascript 
Javascript :: find all images without alternate text 
Javascript :: express js server 
Javascript :: selecionar valselect2 js 
Javascript :: javascript stop delay 
Javascript :: inarray javascript 
Javascript :: formdata to json 
Javascript :: jquery get unique values from array 
Javascript :: rounding off in javascript 
Javascript :: javascript falsy values 
Javascript :: how to return 5 records instead of 10 records in datatable in laravel 
Javascript :: jest-environment-jsdom cannot be found 
Javascript :: copy to clipboard react native 
Javascript :: javascript hover event 
Javascript :: react event target square brackets 
Javascript :: string to title case javascript 
Javascript :: javascript convert string to number or integer 
Javascript :: js string array convert to int 
Javascript :: js code to remove class 
Javascript :: angular call function on option select 
Javascript :: jquery key enter events 
Javascript :: mongoose generate objectid 
Javascript :: make ajax calls with jQuery 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =