Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Dynamicaly surround HTML elements with

...

Message #1 by louis.lafruit@p... on Tue, 4 Sep 2001 19:23:25
Let me submit thisproblem.

Suppose a document with "n" elements.

<Body>
<p A first text </p>
<p A second text </p>
<table A table
... elements of that table ...
</table>

<p A third text </p>
...
<p many more text </p>
</Body>

I want to "dynamically" surround part of the document with a parent say
<Div> --- </Div> so as to obtain for example:

 <Body>
<p A first text </p>
<Div>
<p A second text </p>
<table A table
... elements of that table ...
</table>
</Div>
<p A third text </p>

...
<p many more text </p>
</Body>

I succeeded to select the document elements I want to encompass with 
<DIV> ... </Div> and fix then within a textrange. 
Can someone help me ? Many thanks
Louis Lafruit.
Belgium.

  Return to Index