title: Check if text exist in div using jquery
body: <p>I would like to check if the text exist in the div element, so that if text matches the text in div it will alert "hello". May I know how am I able to achieve this result? Thank you.</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function(){
          var text = "div[style*=\"width: 550px;\"]";
          if (#content.indexOf(text) &gt; -1){
              alert("Hello");
          }
      });
    &lt;/script&gt;
    &lt;div id="content"&gt;
      &lt;div style="width:550px;"&gt;James&lt;/div&gt;
      &lt;div style="width:500px;"&gt;Amy&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>