gpt4 book ai didi

JQuery 选择表中 br 和 td 内的文本

转载 作者:行者123 更新时间:2023-12-01 07:00:41 25 4
gpt4 key购买 nike

我试图让 JQuery 正确地从以下 html 结构中选择文本:

<TABLE class=ms-formtable>
<TBODY>
<TR></TR>
<TR></TR>
<TR></TR>
<TR></TR>
<TR></TR>
<TR>
<TD><H3><NOBR>Select this text</NOBR></H3></TD>
<TD></TD>
</TR>
</TBODY>
</TABLE>

最佳答案

简单选择器

$('nobr').text();

更明确的选择器

$('table.ms-formtable > tbody > tr > td > h3 > nobr').text();

<强> An example to play with

关于JQuery 选择表中 br 和 td 内的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4281421/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com