I have table row that I'm building in JavaScript. This row has an onClick function. I have to pass some values in this function but I'm getting an error. I think that my single and double quotes do not match. Here is my code:
insRow.innerHTML = "<tr><td><img src='../images/delete.png' border='0px' alt='Delete' title='Delete' onclick='pgDelete('"+fnObj.DATA+"','"+dType+"','"+tblID+"');' /></td></tr>";
Error message:
SyntaxError: expected expression, got '}'
If I inspect the element in dev tools this is what I get:
<img src="../images/delete.png" alt="Delete" title="Delete" onclick="pgDelete(" 8739','att','dba');'="" border="0px">
If anyone can help with this problem please let me know. Thank you.