jsFiddle
I'm trying to append some text to a heading that is in a span. But I don't know how to append to the actual heading, and not just the span.
Style:
h1 {font-size:250%;color:red;}
HTML:
<span class="note">
<h1>
some text
</h1>
</span>
I run this:
$('.note:first-child').append("more text");
But the text gets appended after the heading tag, and therefore doesn't have the heading style applied to it. How can I append to the heading?
http://jsfiddle.net/bTubp/2/
$('.note h1:first-child').append("more text");
for inserting inside the first h1
of every .note
class
and
$('.note:first-child h1').append("more text");
for inserting inside text for h1
of first .note
class
For first h1
of first .note
$('.note:first-child h1:first-child').append("more text");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With