how can I insert some HTML code between
using javascript?
Ex:
That's really kind of an ambiguous request. There are many ways this can be accomplished.
document.getElementById('mydiv').innerHTML = 'Something';
That is the simplest. OR;
var spn = document.createElement('span');
spn.innerHTML = 'Something';
spn.className = 'prego';
document.getElementById('mydiv').appendChild(spn);
Preferred to both of these methods would be to use a Javascript library that creates shortcut methods for the simple things like this, such as mootools. (http://mootools.net)
With mootools this task would look like:
new Element('span', {'html': 'Something','class':'prego'}).inject($('mydiv'));