Please find the code below. When I'm trying to pass the variable tmp_lnk from the onclick event to the function it throws up an error that tmp_lnk is not defined. How do I pass the variable to the function?
if(fig_name[1]==img_name)
{
var tmp_lnk = "Supplementary Notes for Images/"+"6H-"+img_name/img_name+".pdf"
$("#notes1").append('<div><a onclick="On_Click(tmp_lnk)" id="closebutton">NOTES</a></div>')
break;
}}
function On_Click(tmp_link)
{
window.open("tmp_lnk");
}
}