title: How do I add text to specific div element using jQuery?
body: <p>I am having a problem with jquery. My HTML is</p>
  <pre><code>&lt;div id=&quot;first&quot;&gt;
     &lt;span class=&quot;test&quot;&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div id=&quot;second&quot;&gt;
     &lt;span class=&quot;test&quot;&gt;&lt;/span&gt;
  &lt;div&gt; 
  </code></pre>
  <p>Now I am trying to add text in span using Jquery.</p>
  <pre><code>$j('span.test').text('Welcome');
  </code></pre>
  <p>After that it becomes,</p>
  <pre><code>&lt;div id=&quot;first&quot;&gt;
      &lt;span class=&quot;test&quot;&gt;Welcome&lt;/span&gt;
  &lt;/div&gt;
  &lt;div id=&quot;second&quot;&gt;
      &lt;span class=&quot;test&quot;&gt;Welcome&lt;/span&gt;
  &lt;div&gt; 
  </code></pre>
  <p>But, I am tryting to achieve is,</p>
  <pre><code>&lt;div id=&quot;first&quot;&gt;
      &lt;span class=&quot;test&quot;&gt;Welcome&lt;/span&gt;
  &lt;/div&gt;
  &lt;div id=&quot;second&quot;&gt;
      &lt;span class=&quot;test&quot;&gt;&lt;/span&gt;
  &lt;div&gt;
  </code></pre>
  <p>How can I do that in jquery?</p>