title: Why onclick javascript remove not working?
body: <p>Here's my codes:</p>
  <pre><code>&lt;script&gt;
      $(document).ready(function(){
          addColor = function(){
              let html = '&lt;div class=&quot;row no-gutters&quot;&gt;\n'+
                  '&lt;div class=&quot;col-md-3&quot;&gt;\n'+
                  '&lt;label for=&quot;color_name&quot; class=&quot;ml-1&quot;&gt;Color name:&lt;/label&gt;\n'+
                  '&lt;input type=&quot;text&quot; id=&quot;color_name&quot; name=&quot;color_name[]&quot; class=&quot;form-control w-auto d-inline&quot;&gt;\n'+
                  '&lt;/div&gt;\n'+
                  '&lt;div class=&quot;col-md-3&quot;&gt;\n'+
                  '&lt;label for=&quot;color_code&quot; class=&quot;ml-1&quot;&gt;Color code:&lt;/label&gt;\n'+
                  '&lt;input type=&quot;text&quot; id=&quot;color_code&quot; name=&quot;color_code[]&quot; class=&quot;form-control w-75 d-inline jscolor&quot;&gt;\n'+
                  '&lt;/div&gt;\n'+
                  '&lt;div class=&quot;col-md-1&quot;&gt;\n'+
                  '&lt;a onclick=&quot;addColor()&quot; class=&quot;btn btn-info&quot;&gt;&lt;i class=&quot;fas fa-plus&quot;&gt;&lt;/i&gt;&lt;/a&gt;\n'+
                  '&lt;a onclick=&quot;deleteColor()&quot; class=&quot;btn btn-danger&quot;&gt;&lt;i class=&quot;fas fa-times&quot;&gt;&lt;/i&gt;&lt;/a&gt;\n'+
                  '&lt;/div&gt;\n'+
                  '&lt;/div&gt;';
              $('#box').append(html)
          };
          deleteColor = function () {
              $(this).parent().remove();
          };
      });
  &lt;/script&gt;
  </code></pre>
  <p>I want to remove the <code>onclick=deleteColor()</code> so the link cannot be clicked or <code>check()</code> won't be fired. How can I do it with JQuery?</p>