如
closest()
是一个jQuery函数,你需要使用它与jQuery对象。同样使用
.prop()
得到任何财产。
this
指的是原生DOM元素,它没有上述方法。使用with jQuery对象。
$(this).closest(‘tr’).prop(‘id’);
// $(this).closest(‘tr’).prop(‘id’); //OR you can also use .attr()
</code>