title: How to check if element have any text
body: <p>How can I check, if element does have any text? I have found some code, but it does not work. I need to do something like this: If element has text, write this, if not, write something else.</p>
  
  <pre><code>    if (!$('.flexslider .item:first p').text().trim().length) {
          var text = $(this).text();
          $('.text-anim-sphone').html(text);
      }
      else {
          $('.text-anim-sphone').html('welcome');
      }
  </code></pre>