Answers for "atrribute value fetching anchor tag\"

0

atrribute value fetching anchor tag\

$(document).on('click' , '.reportData' , function(){
   var idProp= $(this).prop('id'); // or attr() 
    var idAttr = $(this).attr('id');
    console.log('using prop = ' + idProp + ' , using attr  = ' + idAttr);
    console.log();
   return false; // to prevent the default action of the link also prevents bubbling 
});
Posted by: Guest on March-25-2021

Browse Popular Code Answers by Language