Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js event target

const button = document.querySelector(".button");

button.addEventListener("click", function (evt) {
    // the event Target variable will contain the button element that we clicked on
    const eventTarget = evt.target;
    eventTarget.setAttribute("disabled", true);
}); 
Source by practicum.yandex.com #
 
PREVIOUS NEXT
Tagged: #js #event #target
ADD COMMENT
Topic
Name
9+6 =