title: Adding an onclick button corresponding to my JQuery script
body: <p>I am making an html table which will be blank and will have values being input by the user. When the values have been input, I have one cell of the table which will be showing the result of the formula function that I have created in Jquery. My formulas work fine when I already input the values; however, when I try to have an input field and run the code, my submit button on onclick doesn't work. Can someone please tell me how do I create a submit button? I am pasting my JQuery code below.</p>
  
  <pre><code>    $("td[formula]").each(function mathfunction() {
    //1 get formula attribute
    var formula = $(this).attr('formula');
  
    //2 use regex to make expression, with the surpport of "A122"， "AB1" and more
    var expression = formula.replace(/([A-Z]+[0-9]+)/g, "parseFloat(\$('#$1').html())");
  
    //3 eval the expression
    var result = eval(expression);
  
    //4 set the value
    $(this).html(result);
  
  });
  </code></pre>
  
  <p>My JSFiddle Link is in the comments section.</p>