I\'m currently using TinyMCE and would like to add a custom button that works as follows:
ed.addButton('mybutton', { title: 'My button', class: 'MyCoolBtn', image: 'MyCoolBtn.png', onclick: function() { // Add your own code to execute something on click ed.focus(); ed.selection.setContent('' + ed.selection.getContent() + ''); } });