I have a JS Function:
function zoom(now) {
document.getElementById("popup").style.display = "block";
document.getElementById("photos").style.backgroundImage = "url('" + now + "')";
}
And I have echoed in php, which has onclick function
echo
"<td style='background: url(" . $row['thumbnails'] . ")' onclick='zoom(" . $row['imagelink'] . ")'></td>";
So it says
Uncaught SyntaxError: Unexpected token ILLEGAL.
When I put just 1.jpg in php instead of imagelink it works. but not with $row['imagelink']. I absolutely need to change background image, so please if anyone can help or give me a different option in JS, PHP, HTML only. Thank you