How to add an element in the middle of content

Discussion in 'JavaScript' started by batman4444, Nov 13, 2008.

  1. #1
    I am trying to add a new element (HTML tag) into the content of a page via java script DOM, the tricky thing is that i would like to add it into the middle of content not just append it before or after a existing node.

    for example, I would like to change this

    <div>hello this is some sample text to illustrate a point</div>

    to this using the DOM

    <div>hello this is some <b>sample text</b> to illustrate a point</div>

    any ideas?
    Thanks
     
    batman4444, Nov 13, 2008 IP
  2. rene7705

    rene7705 Peon

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    rene7705, Nov 13, 2008 IP