Forum Moderators: open
$(function() {
$('[data-richbutton=Bold], [data-richbutton=Italic], [data-richbutton=Underline], [data-richbutton=Cut], [data-richbutton=Copy], [data-richbutton=Paste]')
.on('mousedown', function(e) {
// I need the B, I, U, C, or P instead of the whole word
var thisButton = $(this).data('richbutton').charAt();
console.log('a - ' + thisButton);
$('[data-richcont="' + thisButton + '"]').toggleClass('richbuttonOff, richbuttonOn');
console.log('b - ' + thisButton);
changeSpan(e, $(this).data('richbutton'));
console.log('c - ' + thisButton);
});
}); $('[data-richcont="' + thisButton + '"]')
.toggleClass('richbuttonOff, richbuttonOn')
.error(function() {
console.log('error here');
}); $('[data-richcont="' + $(this).data('richbutton').charAt() + '"]')
.toggleClass('richbuttonOff, richbuttonOn');