Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix [set/get/remove]Attribute #5

Open
termi opened this issue Aug 20, 2012 · 1 comment
Open

fix [set/get/remove]Attribute #5

termi opened this issue Aug 20, 2012 · 1 comment

Comments

@termi
Copy link
Owner

termi commented Aug 20, 2012

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));
@termi
Copy link
Owner Author

termi commented Aug 20, 2012

for IE8
Element.prototype.[set/get/remove]Attribute

termi added a commit that referenced this issue Aug 20, 2012
@termi termi closed this as completed Aug 20, 2012
@termi termi reopened this Aug 20, 2012
termi added a commit that referenced this issue Aug 25, 2012
More fixes for IE8 Element.prototype.getAttribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant