📜  属性值获取锚标记\ - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:00.744000             🧑  作者: Mango

代码示例1
$(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 
});