I created a custom button that will add a div with a style float, but I want it to appear around the selected text. How do I do this?
So far in my script I have this...
<script type="text/javascript">
function ProTools(commandName) {
switch(commandName) {
case('FloatRight'):
var htmlEdit = HtmlEditor.GetHtml();
HtmlEditor.ExecuteCommand(ASPxClientCommandConsts.PASTEHTML_COMMAND, '<div style="float: right;">' + htmlEdit + '</div>');
break;
}
}
</script>
But it takes the entire html that is in the editor. How do I get just what is highlighted.