开发者

Deleting properties of DOM elements

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜