title: How to change class value in input with append use javascript or jquery
body: <p>How to change name of class in input, this is my HTML code:</p>
  
  <pre><code>&lt;div id="c"&gt;
      &lt;div class="aaa"&gt;
          &lt;input id="b" name="aa" class="a" /&gt;
          &lt;input id="b" name="aa" class="a nhay" /&gt;
          &lt;input id="b" name="aa" class="a" /&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript: </p>
  
  <pre><code>$(document).on('keyup', '.nhay', function (e) {
      if (e.keyCode == 13) {
          $(this).removeClass('a nhay');
  
          $('#c').append('&lt;div class="aaa"&gt;&lt;input id="b" name="aa" class="a"/&gt;&lt;input id="b" name="aa" class="a nhay"/&gt;&lt;input id="b" name="aa" class="a"/&gt;&lt;/div&gt;');
      }
  });
  </code></pre>
  
  <p>I want it like this when I press enter</p>
  
  <p>out HTML:</p>
  
  <pre><code>&lt;div id="c"&gt;
      &lt;div class="aaa"&gt;
          &lt;input id="b" name="aa" class="a" /&gt;
          &lt;input id="b" name="aa" class="new name" /&gt;
          &lt;input id="b" name="aa" class="a" /&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>