Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Dynamicaly surround HTML elements with DIV


Message #1 by "Louis LAFRUIT" <louis.lafruit@p...> on Wed, 5 Sep 2001 11:40:19 +0200
Subject:	Dynamicaly surround HTML elements with DIV

Let me submit this problem.

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>
<p A third text </p>
</Div>
...
<p many more text </p>
</Body>

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

  Return to Index