I'm using the next code block to insert an image on a editable div. I want to know if it's possible to add a class on the fly to the image...
function insertImg() {
var src = prompt('Please specify the link of the image.');
if(src)
{
document.execCommand('insertImage', false, src);
}}
something like this:
<img src="xxxxx.gif" class="myClass">
Try this: