Http://www.css88.com/jqapi-1.9/first-of-type/index.html#p=//www.css88.com/jqapi-1.9/last-child-selector
---dynamically added table TR to TR set click event using jquery 1.9
function () {$ ("#tableid tbody"). Find ("tr"). Removeclass ("Trclass"); $ (this). AddClass ("Trclass" ); var name = $ (this). attr ("Data"); $ ("#txtsearch"). Val (name);});
functionchangetable () {varn = $.trim ($ ("#txtsearch"). Val ()); if(n! = ""{$.ajax ({type:"POST", URL:".. /xxx/xx.aspx?action=getxx ", data: {N: n}, DataType:"JSON", Async:false, Success:function(data) {varVarc = ""; $.each (data. Table,function(Index, item) {Varc+ = "<tr data=" + item.id + "><td>" + item.id + "</td><td>" + item.name + "</td></tr> ;"; }); $("#tableid tbody"). Empty (). append (Varc); }, Error:function () { } }); } }
--first (First-of-type) Last (Last-of-type)
function () { var n1 = $ (thisvar n2 = $ (this). attr ("data2"); Down (N1, N2); }); $ (document). On (function () { var n = $ (this). attr ("Data" ); Delattach (this, n); });
Table dynamically added TR its Click event does not perform the jquery 1.9 live event and gets first last
in IE compatibility mode