Here is my code that works but isn't very practical:
var blank1 = document.getElementById("blank1");
var this_image_filename = "/rgsi/images/poi-" + image_id + "-1--4.jpg";
blank1.innerHTML = "<div id='blank1' onclick=displayImg('" + this_image_filename + "') >1</div>";
The issue with this is that if you use inspect element in Chrome you get:
<div id="blank1">
<div id="blank1" onclick="displayImg('/rgsi/images/poi-64-1--4.jpg')">1</div>
</div>
which is not good at all.
I attempted to use replaceChild() as listed in this question here:
How to replace DOM element in place using Javascript?
but I keep getting:
Uncaught NotFoundError: Failed to execute 'replaceChild' on 'Node': The new child element is null.
So the question is: what is the simplest way to correctly do this?
Any input is appreciated.