Is there a way to delete properties of DOM elements? I'm using a widget that upon rendering itself adds tabindex
attributes to certain nodes. I'd like to remove them because they cau开发者_如何学编程se unwanted visual changes.
I tried the following which does not seem to have any effect (tabindex
stays the same):
delete domNode.tabIndex;
domNode.tabIndex = undefined;
As I recall, you can use the removeAttribute
method. So, in your case:
[DomElement].removeAttribute('tabindex');
should do the trick.
精彩评论