1

how to find the latest modified(newly added or changed) row of html table.

Hashan
  • 164
  • 8
  • 2
    You can use `MutationObserver` see [call function on change of value inside

    tag](http://stackoverflow.com/questions/37452164/call-function-on-change-of-value-inside-p-tag/)

    – guest271314 Feb 16 '17 at 07:35

1 Answers1

0

Plain way to achieve this by maintaining a flag in latest row.

let's say flag-name/class-name = "latest"

1) Remove all row with flag/class name latest

$('#resultTable tr').removeClass("latest");

2) when you add a new row add latest class to it

let's say newly added/modified row id is row1

$('#row1').addClass("latest");

you can get the latest row by calling.

var latest = $('.latest')[0];
Darshan
  • 447
  • 3
  • 17