jQuery:在div中设置表格单元格的值 [英] jQuery: set value of table cell inside div

查看:76
本文介绍了jQuery:在div中设置表格单元格的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含标题的浮动div,我想要更改该标题。我试过这个:

I have a floating div which contains a title and I want to change that title. I tried this:

$("div#dragTitle3").text("New Title");

但标题实际上位于div内的表格中。这是表格:

But the title is actually in a table inside the div. This is the table:

<table><tbody><tr><td>Announcements</td><td style="text-align:right"><img src="buttontop.png" class="divTitleButton" id="dragButton3" onmousedown="javascript:toggleContentWin(3)"></td></tr></tbody></table>

我想知道当我设置新的时候如何在不输入整个表的代码的情况下更改标题表。

I want to know how I can change the title without entering the whole table's code when I set the new table.

推荐答案

这应该有效:

$("div#dragTitle3 td:first").text("New title")

这篇关于jQuery:在div中设置表格单元格的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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