Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    insert After HTML tag??

    Hi everybody
    I have known insertBefore which insert HTML tag before another HTML tag.
    Now I want insert HTML tag AFTER another HTML tag.
    I searched, but not found. There isn't insertAfter
    Anybody can help me?
    Please
    Thanks

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this.
    Code:
    if(el.nextSibling) el.parentNode.insertBefore(newEl, el.nextSibling);
    else el.parentNode.appendChild(newEl);
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •