title: jQuery add text to span when div is visible
body: <pre><code>&lt;div class="box"&gt;
  &lt;span class="test"&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;&lt;/div&gt;
  &lt;input type="button" value="Add" id="button"&gt;
  
  &lt;style type="text/css"&gt;
      .box {
          display: none;
       }
  &lt;/style&gt;
  </code></pre>
  
  <p>above div is not visible when page is load. We are making div visible after button click. Now i want to append text to span when div is visible.</p>
  
  <pre><code>$('#button').on("click",function(e){
     e.preventDefault();
     $('.box').clone().show().append('.row');
  });
  </code></pre>
  
  <p>I tried this </p>
  
  <pre><code>1) $(".box").closest(".test").text("hello");
  2) $(".box").find(".test").text("hello");
  </code></pre>
  
  <p>But it is not adding text into span.</p>