如何使用jQuery获取TD值.? [英] How to get TD value using jQuery.?

查看:25
本文介绍了如何使用jQuery获取TD值.?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试像这样使用 jquery 获取 td 的值.

I am trying to get value of td using jquery like this.

$("#id").find(".class").attr('value'); 
//or
$("#id").find(".class").val();

虽然它有一个值,但都返回空字符串.注意* 我正在尝试获取动态创建的元素的值.提前致谢.

both returns empty string although it has a value. note* i'm trying get value of dynamically created element. thanks in advance.

推荐答案

就写

$("#id .class").text();

或者为了使用 HTML,

Or to get the HTML use,

$("#id .class").html();

这篇关于如何使用jQuery获取TD值.?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆