title: dynamically creating div using javascript/jquery
body: <p>I have two div called "answerdiv 1" &amp; "answerdiv 2" in html.</p>
  
  <p>now i want to give/create div id uniquely like "answerdiv 3" "answerdiv 4" "answerdiv 5" and so on.</p>
  
  <p>Using javascript/jquery how can i append stuff in these dynamically created divs which id should be unique?</p>
  
  <p>in my project user can add "n" numbers of  div, there is no strict limit to it.</p>
  
  <p>Help me out.</p>
  
  <p>Thanks in Adv</p>
  
  <p>================================================================================</p>
  
  <p>My HTML code is:    </p>
  
  <pre><code>&lt;div id="answertextdiv"&gt;
     &lt;textarea id="answertext" name="answertext" placeholder="Type answer here" rows="2" cols="40" tabindex="6" onBlur="exchangeLabelsanswertxt(this);"&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My JS code:</p>
  
  <pre><code>function exchangeLabelsanswertxt(element)
  {
      var result = $(element).val();
      if(result!="")
      {
          $(element).remove();
          $("#answertextdiv").append("&lt;label id='answertext' onClick='exchangeFieldanswertxt(this);'&gt;"+result+"&lt;/label&gt;");
      }
  }
  function exchangeFieldanswertxt(element)
  {
      var result = element.innerHTML; 
      $(element).remove();
      $("#answertextdiv").append("&lt;textarea id='answertext' name='answertext' placeholder='Type answer here' rows='2' cols='40' tabindex='6' onBlur='exchangeLabelsanswertxt(this);'&gt;"+result+"&lt;/textarea&gt;");
  }
  </code></pre>
  
  <p>Now from above code I want to append all stuff in unique "answertextdiv" id.</p>