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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -