javascript - 如何在jquery中使用span类获取<td>值

标签 javascript jquery xhtml

我的 table 是

<table id="ResumeWrite" class="Vasprice" cellpadding="0" cellspacing="0" border="0" width="100%">
 <tr>
       <th width="20%" class="bdrL_blue valignT highlight">
       <span class="font18">0 to 1 year Experience</span>
       </th>

       <th>
        <input type="button" value="submit"/>
       </th>
</tr>

我想在单击按钮时提醒值0 到 1 年经验。 jquery 中怎么做?

最佳答案

您可以通过多种方式做到这一点。我认为最简单的是:

$(".font18").text();
$(".font18").html();

$("#ResumeWrite span.font18").text();

最后一个字符串只会提高查找所需项目的准确性。

关于javascript - 如何在jquery中使用span类获取<td>值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19974731/

相关文章:

通过涉及特殊字符的 XSL 转换输出 HTML

javascript - 使用 array.map、promises 和 setTimeout 更新数组

javascript - 如何访问另一个 HTML 页面的 DOM,以测试来自 QUnit 的 DOM 操作函数

jquery - 如何使用 ajax 让 Twitter Bootstrap Collapse 在动态加载的 html 上工作

javascript - 将 jQuery 错误处理添加到 JSF 页面上列表、网格内的所有图像

ruby-on-rails - 使用 Ruby on Rails 将 XHTML 作为 application/xhtml+xml 提供服务

javascript - 如何动态填充三 Angular 形二维数组?

javascript - 通过javascript函数改变颜色

javascript - 我必须在移动浏览器上显示 1000 多个未分类的图片缩略图,我不知道如何

php - DOMDocument::validate() 问题