Answers for "jquery click button id get"

0

jquery get id of clicked element

$(document).ready(function() {
    $("a").click(function(event) {
        alert(event.target.id);
    });
});
Posted by: Guest on January-02-2022
3

jquery on click get element

$(document).on("click",".appDetails", function () {
   var clickedBtnID = $(this).attr('id'); // or var clickedBtnID = this.id
   alert('you clicked on button #' + clickedBtnID);
});
Posted by: Guest on September-07-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language