I am trying to append HTML syntax with javascript and onClick trying to pass a function with 2 parameters. But while passing the parameters I am doing something wrong in concatenation. Please help.Here is the append code.
addPanelHtml += "<li><a href='#' id='btnhistory" + i+ "' onclick='histDrpDwnEdt("+chkval+"','" + i+ ")'>History Parameters</a></li>";
while running the program I am getting error:
Uncaught SyntaxError: Unexpected end of input
addPanelHtml += "<li><a href='#' id='btnhistory" + i + "'" + " onclick='histDrpDwnEdt("+chkval+"','" + i+ ")'>History Parameters</a></li>";addPanelHtml? Can you provide more of your code please?onclick='histDrpDwnEdt("+chkval+"','" + i+ ")you should remove the single quote signs around the comma (if bothchhvalandiare numeric values):onclick='histDrpDwnEdt("+chkval+"," + i+ ")or you should add one beforechvaland one aferi(if they are string values):onclick='histDrpDwnEdt('"+chkval+"','" + i+ "').chhvalandiare string values, you should add the single quote signs and escape them:onclick='histDrpDwnEdt(\'"+chkval+"\',\'" +i+ "\')