Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

if button is pressed js

<button>A</button>
<button>B</button>
<button>C</button>
<script>
  document.body.addEventListener("click", event => {
    if (event.target.nodeName == "BUTTON") {
      console.log("Clicked", event.target.textContent);
    }
  });
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: disable unused vars 
Javascript :: update an item in array of object 
Javascript :: js absolute value 
Javascript :: js check if object is empty 
Javascript :: javascript truncate string full word 
Javascript :: js decode base64 
Javascript :: filter falsy values 
Javascript :: array unique values javascript 
Javascript :: disable text selection in js 
Javascript :: checkbox on click jquery 
Javascript :: javascript new date 30 days ago 
Javascript :: remove selected bar mui tabs 
Javascript :: check box all in jequery data table 
Javascript :: between in mongodb 
Javascript :: discordjs delete all messages in channel 
Javascript :: pagination jsonplaceholder 
Javascript :: slice string javascript from index to space 
Javascript :: how to validate age above 18 in javascript 
Javascript :: vuejs set 
Javascript :: javascript add new line in string 
Javascript :: refresh event in javascript 
Javascript :: express start template 
Javascript :: iterate over map key value javascript 
Javascript :: mongodb filter empty array 
Javascript :: hide label chratjs 
Javascript :: google maps init map 
Javascript :: detect two strings are anagram of each other in JavaScript 
Javascript :: create angular app with routing and scss 
Javascript :: two decimal places in javascript 
Javascript :: send data in res.render in express js 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =