Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/366.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何获取gridview中最后一个td的值_Javascript_Jquery Ui_Jquery - Fatal编程技术网

Javascript 如何获取gridview中最后一个td的值

Javascript 如何获取gridview中最后一个td的值,javascript,jquery-ui,jquery,Javascript,Jquery Ui,Jquery,我试着得到最后一个tr和最后一个td var lastimageId = $("#GVUserWebDetail tr:last").children("td:first").html(); 但返回值为null 请给出解决方案 我试着得到最后一个tr和最后一个td 如果要获取最后一行和单元格,请执行以下操作: $(function() { var bottomRightCell = $("#GVUserWebDetail tr:last-child td:last-child");

我试着得到最后一个tr和最后一个td

  var lastimageId = $("#GVUserWebDetail tr:last").children("td:first").html();
但返回值为null

请给出解决方案

我试着得到最后一个tr和最后一个td

如果要获取最后一行和单元格,请执行以下操作:

$(function()
{
    var bottomRightCell = $("#GVUserWebDetail tr:last-child td:last-child");

    var message = 'id: ' + bottomRightCell.attr('id') + '\n';
    message += 'text: ' + bottomRightCell.text();

    alert(message);
});​

对象对象警报显示的不是上一个TDP的值。这是正确的,它是一个对象,更确切地说是一个jQuery对象。您试图访问哪些信息?var bottomRightCellId=bottomRightCell.attr'id';为了清晰起见,我添加了一个JSFIDLE演示。它确实有用您正在使用ASP.NET网格视图吗?请提及