1

I'm using jHtmlArea and i need to create a custom button to wrap text inside a span tag. I managed to understand how to put the button in the toolbar but i cannot understand what i have to do to get the selected text, change it and put it back in that jHtmlArea iframe.

If someone can help, i'll appreciate.

Thank u all

TiagoDias
  • 1,785
  • 1
  • 16
  • 21

1 Answers1

0

I used this for example:

            {
                css: "float-left",
                text: "Pull left",
                action: function(btn) {
                    var s = this.getSelectedHTML();
                       s = "<span style='/*some css rules*/'>" + s + "</span>";
                    this.pasteHTML(s);
                }
            }
birko
  • 1,356
  • 1
  • 9
  • 13