jquery - Getting td value returns undefined -


i trying access td value of row above context. able row above prev() method , children children() method, when append find() selector onto that, unable find particular cell looking for.

when log return children() see table data have in there.

why cant find id? see code below.

$("#tblproducts tbody").on("click", "#btnsubmitupdate", function (e) {     var btnsaveupdate = $(this);      var tr = btnsaveupdate.closest("tr");      var trabove = $(tr.prev()[0]);     var desc = trabove.children().find("#tddescription").val();      //desc returning undefined     console.log(desc); }); 

i needed use find() directly trabove without using children. solved issue


Comments

Popular posts from this blog

c++ - What's the differece between of link to a dynamic file and as a input object? -

javascript - Feed FileReader from server side files -

Android Unit Testing / Mockito: android.location.Location not mocked -