W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: Inserting text between HTML tags

From: John Snelson <jpcs@decisionsoft.com>
Date: Thu, 21 Jun 2001 09:03:32 +0100
Message-ID: <3B31AA54.A480C8BC@decisionsoft.com>
CC: "'www-dom@w3.org'" <www-dom@w3.org>
The only way to do this is to use string manipulation, and split the
text node yourself. You should delete the original node, and create two
text nodes in it's place, with the values of the text before and after
line 3. Then you can insert nodes between these two new text nodes.


Deepika Nattuva wrote:
> Hi,
> I have a small question which I could not find in your archives.
> It is as follows:
>         Can I insert HTML or text at a particular location in the text
> enclosed betwen tags.
>         I mean suppose if I have a paragraph tag like this enclosing 7 lines
> betwwen the tags.
>         Can I insert some HTML programmatically after line 3, for eg..?
>         If yes how do I do it?
>         <P>
>         line 1: Kolkata, June 20: The Justice Manoj Mukherjee Commission
> probing the mysterious  line 2: disappearance of Netaji Subhas Chandra Bose
> has recorded an affidavit by a freedom  line 3: fighter who claimed to have
> met Netaji in Myanmar in 1954, years after Bose reportedly      line 4: died
> in the Taihoku air crash. Mubarak Mazdoor, who described himself as a
> freedom         line 5: fighter and close associate of Jawaharlal Nehru and
> Rafi Ahmed Kidwai, said in the  line 6: affidavit that Netaji had been
> living in the guise of a Buddhist monk named 'Mong' in the      line 7:
> Golden Pagoda in Myanmar when he had met him.
>         </P>
> Anticipating a positive response. I would appreciate it.
> Thanks
> Deepika.

John Snelson, Software Engineer       DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com
Received on Thursday, 21 June 2001 04:00:25 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC