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
Post a Comment