使用jQuery获取元素的所有属性attributes
attributes
$(this).each(function() { $.each(this.attributes, function() { // this.attributes is not a plain object, but an array // of attribute nodes, which contain both the name and value if(this.specified) { console.log(this.name, this.value); } }); });
给心灵一个纯净空间,让思想,情感,飞扬!