how can I insert some HTML code between ... using javascript?
...
Ex:
document.getElementById("mydiv").innerHTML = "Something";
Should do it. If you are willing to use jQuery it could be easier.