deleting a row of table that cursor pointing to it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sathisharavind
    New Member
    • Apr 2016
    • 2

    deleting a row of table that cursor pointing to it

    deleting a row of table that cursor pointing to it.so can any one help me how to do this..?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you are aware that by merely pointing the cursor at a row it may delete more rows than you intend to delete (since when one row is deleted, the next row is placed under the cursor).

    anyways, the core principle for deleting a row is quite simple.

    Code:
    // evt - the event object received when the desired event is triggered
    var row = evt.target.closest('tr');
    row.parentNode.removeChild(row);

    Comment

    • sathisharavind
      New Member
      • Apr 2016
      • 2

      #3
      Thanks for your response.but i did tried it before its not working

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        "not working" is not a useful error description. what is happening that shouldn’t (and vice versa)? what about the error console? have you checked using break points?

        and as far as the example code is concerned, it does work (albeit not in IE).

        Comment

        Working...