I have the following HTML;
<p class="postcontent">
<img src="#">
Some Text
</p>
I want to be able to hide only the text.
So far I have this;
jQuery(function($) {
$(".postcontent").$('[type=text]').hide();
});
Edit: I don’t have any control over the html so I need to add it by Jquery.
You can wrap the text on the FLY and then hide it:
HTML:
Javascript:
JSFiddle
Update based on a comment:
Why does it create two labels? that’s easy because it has two text nodes…: