title: How to change label text using jquery
body: <p>This is div tag</p>
  
  <pre><code>&lt;div&gt;
      &lt;label&gt;some text 1&lt;/label&gt;
      &lt;label&gt;another text 1&lt;/label&gt;
  &lt;/div&gt;
  &lt;button&gt;button&lt;/button&gt;
  </code></pre>
  
  <p>Whenever I click on the button, I will add the div tag. when the next div tag is added, it should change the digit in the label text.</p>
  
  <p>For example: In the first div, it should be <code>1</code> and in the next div it should be <code>2</code>.</p>
  
  <p>I am getting the label text using </p>
  
  <pre><code>var labelValue = $('div').find('label').map(function() {
     return $(this).text().replace(/\d/,2);
  }).get();
  </code></pre>
  
  <p>What I want is to change digit in the label text to 2.</p>
  
  <p>I am getting the value but the label value is not getting changed in the html.</p>
  
  <p>How to get the updated label value?</p>
  
  <p>Sorry if there are any mistakes</p>