HTML button onclick function not working with jQuery variable as argument
<pre><code>success: function(jsonresponse) {
    data = JSON.stringify(jsonresponse);

  $.each(JSON.parse(data), function (index, item) {
    var Id=item.id;
    var JobId=item.JobId;

 var eachrow = "&lt;tr&gt;"
             + "&lt;td&gt;" + item.id + "&lt;/td&gt;"
             + "&lt;td&gt;" + item.JobId + "&lt;/td&gt;"
             + "&lt;td&gt;" + item.UserId + "&lt;/td&gt;"
             + "&lt;td&gt;" + item.updatedAt + "&lt;/td&gt;"
             + "&lt;td&gt;" + "&lt;button onclick='myFunction(JobId,Id, \"accepted\")' class='btn btn-success btn-block'&gt;Reject&lt;/button&gt;" + "&lt;/td&gt;"
             + "&lt;td&gt;" + "&lt;button onclick='myFunction(JobId,Id, \"rejected\")' class='btn btn-success btn-block'&gt;Reject&lt;/button&gt;" + "&lt;/td&gt;"
             + "&lt;/tr&gt;";

 $('#tbody2').append(eachrow);
 });

},
</code></pre>

<p>myFuntion(JobId,Id,\"accepted\") does not works with variable as parameter but when manually added then the function works, like myFuntion(1,3,\"accepted\").</p>