how to style text after ?
16lz
2021-01-22
I am trying to use clone()
and I'm close to it but I cannot replace the text, it is showing both:
我正在尝试使用clone()并且我接近它但我无法替换文本,它显示两者:
var td_clone = $('.ms-vb').clone();
$('span', td_clone).remove();
$('br', td_clone).remove();
var name = $.trim(td_clone.text());
$("td").append(name.toUpperCase());
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<td width="80%" style="padding-bottom: 3px" class="ms-vb">
<span class="ms-announcementtitle">
title is here
</span>
<br>
by hey
</td>
</tr>
</table>
更多相关文章
- 使用jquery animate()实现对文本的反弹效果?
- Jquery禁用/启用按钮与文本框代码
- 获取复选框的文本属性
- jQuery中的bind绑定事件与文本框改变事件的临时解决方法
- 克隆文本并插入壁橱标题范围
- 如何删除/更改JQuery UI自动完成帮助文本?
- jQuery自动完成不适用于多个文本输入
- 如何使用jQuery UI插件使html文本框可拖动和调整大小?
- 在使用javascript将信息输入到输入字段时填充文本区域