如何使用jQuery改变Span的内容? [英] How to change the content of the Span using jQuery?

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

问题描述

<span class="stbuttontext" st_page="home">ShareThis</span>

我要将共享此更改为共享,

I want to change "Share This" to "Share",

请让我知道解决方案。

谢谢,

推荐答案

您可以使用以下两种方式之一:

You can do with either:

$('.stbuttontext').text('Share');

用于文字内容或

$('.stbuttontext').html('Share');

用于 html 内容。

在你的case,第一个语句应该是罚款:)

In your case however, the first statement should be fine :)

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

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