Alex Rivera | Logout

How Do I Replace/Change The Heading Text Inside <h3></h3>, Using jquery?

Asked 2011-12-18T06:33:09.437
57

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>
Edit
Report

2 Answers

47

If you can select it, you can manipulate it.

Try this:

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

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

answered 2011-12-18T06:38:35.023
13

try this,

$(".head h3").html("New header");

or

$(".head h3").text("New header");

remember class selectors returns all the matching elements.

answered 2011-12-18T06:38:49.710

Your Answer