Skip to content

fix [set/get/remove]Attribute #5

@termi

Description

@termi

MDSN:
getAttribute method
setAttribute method
removeAttribute method

For resolve problems with properties and attributes in IE < 8, we can use second parameter in [get/remove]Attribute and third parameter in setAttribute.

var div = document.createElement("div");
div.testValue = 666;
div.setAttribute("testValue", "lolcat");
console.log("property value: " + div.testValue, " ", "attribute value: " + div.getAttribute("testValue"));

div.testValue = 666;
div.setAttribute("TESTVALUE", "lolcat", 1);
console.log("property value: " + div.testValue, " ", "attribute value: " + div.getAttribute("TESTVALUE", 1));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions