jquery - How to add alt to the image src tag in javascript execCommand methode? -
'insert_img': { "text": "inserimage", "icon":"icon icon-picture", "tooltip": "insertimage", "commandname":null, "custom": function(){ var imgsrc = prompt('enter image location', ''); if (imgsrc != null) { document.execcommand('insertimage', false, imgsrc); } } },
i have code this, want give alt image, how can achieve this? when take source wan see <img src="smiley.gif" alt="smiley face">
this, possible? please me.
it seems can't execcommand directly documentation of commands an other one.
you can still in jquery, after adding image (seems bit hackish, know, don't think can better) :
$('img[src="smiley.gif"]').attr('alt','smiley face');
Comments
Post a Comment