0

How do I select only the Text within the span but ignore the child span.

<span class="a">
   My Text for A
   <span class="b">*</span>
</span>

I would like to select only the text. i.e. "My Text for A"...not "My Text for A *" and if there are more than one it should return as an array like a normal selector.

$('.a').text();
KingKongFrog
  • 13,946
  • 21
  • 75
  • 124

0 Answers0