📜  获取所有属性 jqery 的列表 - Javascript 代码示例

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

代码示例1
function getAttributes ( node ) {
    var i,
        attributeNodes = node.attributes,
        length = attributeNodes.length,
        attrs = {};

    for ( i = 0; i < length; i++ ) attrs[attributeNodes[i].name] = attributeNodes[i].value;
    return attrs;
}