PDA

View Full Version : How to insert an intermediate tag



gordon
11 May 2007, 5:15 AM
I have a structure like this:


<body>
<div id="1"></div>
<div id="2"></div>
</body>
I want a structure like this:

<body>
<div id="0">
<div id="1"></div>
<div id="2"></div>
</div>
</body>
Ext.Element.wrap() almost does what I want. I can do some ugly hack to get it working but I'm sure there must be an elegant way to do this.

Suggestions anyone?

Thank you,

Gordon

tryanDLS
11 May 2007, 6:49 AM
Wrap the divs in another container. In your simple example, you might be able to up('body') - I didn't try


<div>
<div id="x"></div>
<div id="y"></div>
</div>
....
Ext.get('x').up('div').wrap();