javascript - JS / JQuery execCommand problem -


I have trouble with execCommand (full) so that you greatly appreciate - I have no doubt that I I am barking but ..... anyway

& lt; 2 & gt; Here's some text & lt; / H2 & gt; Blah blah blah ... & lt; / Div & gt;

This is "editable" i.e. document.designmode = 'on'; - It gets "State" on focus. On Bluetooth it turns it into document.designMode = 'off';

I have a "test button"

  input type = "button" id = "bold" value = "bold" & gt;   

When "clicked" "highlights the text" - so execCommand

So far I have something like this:

 Get the  function () (if (window.getSelection) {return window.getSelection ();} and if (document.getSelection) {return document.getSelection ();} and {var select = document. Selection & amp; ; Amp; document.selection.createRange (); if (selection.Text) {return selection.text;} description is false;} description is false;} $ ('# bold'). Click (function () {var Selection = matching-selection (); alert (selection);});   

Warning (bold click) me Lets the light / selected text, but how can I make it "bold". I think I need to use internal HTML or something?

Help much appreciated - Advance Thanks OH and I do not want to use either an i-frame or texterra

by selecting text Deals.

A cross-browser JavaScript Range and Selection Library This Internet Explorer Between Orr and DOM- compliant browsers across all major browsers to overcome wildly different implementations of this functionality provides a simple, standards-based API to run normal Dome range and selection functions.

You can use text to bold.

Comments