I am trying to change image tag source which is in FCKeditor using JavaScript. Before changing, it's source is: '/images/sample.png'. I am using the script below:
After this, when I tried to get the HTML of the editor, I am getting the previous source i.e., '/images/sample.png'. Script used to get HTML code of the FCK editor is:
How can I change the source of an image tag?
var objImages = FCKeditorAPI.__Instances.FCKeditor1.EditorDocument.body.getElementsByTagName('img'); for( i = 0; i < objImages.length; i++ ) { objImages.src = '/images/sample.gif'; }
After this, when I tried to get the HTML of the editor, I am getting the previous source i.e., '/images/sample.png'. Script used to get HTML code of the FCK editor is:
FCKeditorAPI.__Instances.FCKeditor1.GetHTML();
How can I change the source of an image tag?