Reputation: 2588
I'll try to be concise for this weird issue.
I am hoping to hide text within a "p" tag if there's no child tag present within it.
As an example, if I have following:-
<p class="myflow"> Text <a href="#"> Some Link </a> </p>
I don't want anything to hide, but if there's following:-
<p class="myflow"> Text </p>
Then I want "p.myflow" to hide, as there's no child tag.
I apologize for not writing some initial try, as I have no idea how to approach this.
Thanks.
Upvotes: 0
Views: 68
Reputation: 4570
if ( $('p.myflow').children().length < 1 ) {
$('p.myflow').hide();
}
Upvotes: 2