//获取data属性的几种方法 var id = this.getAttribute('data-id'); var id = $(this).attr('data-id'); var id = $(this).data('id'); var id = this.dataset["id"];
//获取data属性的几种方法 var id = this.getAttribute('data-id'); var id = $(this).attr('data-id'); var id = $(this).data('id'); var id = this.dataset["id"];
转载于:https://www.cnblogs.com/kangkang-saonian/p/10232742.html