Hello and welcome to our community! Is this your first visit?
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
    Dec 2004
    Thanked 0 Times in 0 Posts

    using InnerHtml to dynamically add the rows

    Hi All,
    i am having a tale in HTML page which is having set of rows.
    <table id="tabid"><tr><input ...><img src="add-row.gif"> </tr>
    <tr><input ...></tr>
    <tr><input ...></tr>
    <tr><input ...></tr>
    <!-- need to ad a row here-->

    i need to code a javascript to add a row similar to the one present above when u clik on add-row.gif image but for the 1st row del-row.jpg shud be there to delete the row.

    see the attached file for code

    though this code will give u an idea(but is not complete...similar code is written for the other rows also...)
    I am able to add the rows successfully but facing the probs while deleting..
    facing probs while deleting the 2nd row...3rd row gets deleted..

    pls helpme

    Thanks & Regards
    Mahesh P
    Attached Files Attached Files

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Portsmouth UK
    Thanked 513 Times in 500 Posts
    using innerHTML is NOT the way to do this if you are interested in a DOM solution say


    Posting Permissions

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