this is my original html codes:
<div>
<img src="image/sample.jpg" onmouseover="showTitle('title')">
</div>
But I need it to be converted to javascript, for condition if {{IMAGE(z1)}} do exist, then var x, would be written out as html.
<script>
if ("{{IMAGE(z1)}}" != "") { var x = "<img src="image/sample.jpg" onmouseover='showTitle('title')'></div>";
document.write(x); }
</script>
The image does show; however, it wont read/execute the related javascript functions.
HTML:
onmouseover="showTitle('title')"
Javascript variable double quote (failed):
var x = "onmouseover="showTitle('title')""
Javascript variable single quote (failed):
var x = "onmouseover='showTitle('title')'"
Do you know a workaround of this? Thanks in advance!!