如何使用jquery替换/更改< h3></h3>内的标题文本? [英] How Do I Replace/Change The Heading Text Inside <h3></h3>, Using jquery?

查看:500
本文介绍了如何使用jquery替换/更改< h3></h3>内的标题文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用javascript改为说公共优惠"来更改/替换<h3>文本:精选优惠"?

How do I change/replace the <h3> text: "Featured Offers" using javascript to say "Public Offers" instead?

</div>  <!-- FEATURED OFFERS -->
<div class="panel">
   <div class="head">
      <h3>Featured Offers</h3>
   </div>
   <div class="body">
      <table>
         <thead>
            <tr>

推荐答案

如果可以选择它,则可以对其进行操作.

If you can select it, you can manipulate it.

尝试一下:

$(".head h3").html("your new header");

但是正如其他人所提到的,您可能希望head div具有ID.

But as others mentioned, you probably want head div to have an id.

这篇关于如何使用jquery替换/更改&lt; h3&gt;&lt;/h3&gt;内的标题文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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