How can I get the text in this markup?
<div itemprop="description">
<p>Testing article....</p>
<div class="inline-image inline_image_240x240">
<img alt="" title="" src="http://kite.dev.cnngo.com/sites/default/files/imagecache/inline_image_240x240/2012/06/27/600x600_5.png">
<div class="in-captioninline_image_240x240"></div>
</div>
I want this to put inside the blank <p> element below.
<p></p>
<p>Another p.....</p>
</div>
I want to be like this.
<div itemprop="description">
<p>Testing article....</p>
<div class="inline-image inline_image_240x240">
<img alt="" title="" src="http://kite.dev.cnngo.com/sites/default/files/imagecache/inline_image_240x240/2012/06/27/600x600_5.png">
<div class="in-captioninline_image_240x240"></div>
</div>
<p>I want this to put inside the blank <p> element below.</p>
<p>Another p.....</p>
</div>
Complete Edit:
I see. You won’t be able to move just plain text into that “P” tag so you will need to rap it in another P with a class/id. In this case i’ll give it a class. You also can’t just have a random “
” in there. This would break the html. So I just changed that to: “<p>” so it would turn into text instead of interfearing with the HTML
Change your HTML to this:
You can move that to the next P using .next():
JSFIDDLE