0

I am using extjs and trying to remove a dom element dynamically like this-

if (Ext.getElementById('a'))
    Ext.getElementById('a').remove();

This works fine in Chrome. I am running application on IE9 as well but it throws the error- Object doesn't support property or method remove

Please let me know if there is a workaround.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
unix_user
  • 309
  • 6
  • 21

1 Answers1

1

Ext.getElementById() is a private method - you may want to consider using Ext.get() instead.

Anyhow, if it works in Chrome and not in IE, most likely your dom is invalid - search for missing closing tags, or alternatively validate your dom using an online validator. Also see this.

Community
  • 1
  • 1
Izhaki
  • 23,372
  • 9
  • 69
  • 107
  • Yes. document.getElementById() was the problem. As well does extjs have something similar to this- document.getElementsByClassName() ?? – unix_user Mar 06 '13 at 01:32
  • Well. There can be many elements with the same class. You should look at [Ext.Element.down()](http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Element-method-down). – Izhaki Mar 06 '13 at 01:59