title: Add and Remove button JavaScript
body: <p>I need make button to add and remove that adds and removes inputs.</p>
  
  <p>Did I write normal script or adding button should be another?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const add = document.getElementById("add");
  var i = 0;
  const div = document.getElementById("hobby");
  add.addEventListener("click", function() {
    i++;
    const edit = document.createElement('input');
    edit.id = i;
    edit.placeholder = "More hobbies";
    //Also I need add remove button for each input, which removes its input
    div.appendChild(edit);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="hobby"&gt;
    &lt;input placeHolder="Type your hobby"&gt;
    &lt;button&gt;X&lt;/button&gt;
    &lt;!--Remove button--&gt;
  &lt;/div&gt;
  &lt;button id="add"&gt;Add hobby&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>