0

I have a custom menu bar plugin for TinyMCE-3.5.10. One of the buttons, marked play is created thus:

 case 'play':
    playBtn = cm.createButton('play', {
    title : 'Play',
    image : 'tinymce/jscripts/tiny_mce/plugins/mainMenuBar/img/play.png',
    onclick : function() {
     readText();
    }
 });
   return playBtn;  

My question:
1. How can I change the image icon for this button programmatically? The command playBtn.renderHTML() does provide me the HTML code with the src parameter showing the location of the image. If I parse the HTML string and change the src parameter to point to a new image, how do I associate this string with the button again?

user3064914
  • 921
  • 1
  • 7
  • 18
Sriram
  • 10,298
  • 21
  • 83
  • 136
  • if you can get the playBtn, then you can use jquery to set the source of the image like this: $(playBtn).attr("src", "myImage.png"); or with classic javascript like this document.getElementById("imageid").src="yourImage.png"; – Ruben Verschueren May 15 '14 at 13:22
  • @RubenVerschueren: Thank you for the suggestion. I tried the jQuery solution you suggested. That did not work. – Sriram May 15 '14 at 16:49

0 Answers0