• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

******Jscript text range*****Ignore sorted

  • Thread starter Thread starter xoggoth
  • Start date Start date
X

xoggoth

Guest
Trying to do a "Make your own Shakespeare Play Handbill" thing, which needs very basic text format controls.

Following works fine if some text is actually selected and pass eg prop as "Bold" but if use control at end of line it does not set the property from that point. The MS wysiwig HTML editor uses exactly same code and that works ok!

with (document.getElementById("handbill"))
{
focus();
rng = document.selection.createRange();
rng.execCommand(prop);
}

Much ta for any ideas (again!)
 
Re: Jscript text range

Re: Jscript text range

SORTED!

rng.select();
rng.moveEnd("character", 1);

I knew that!
 

Advertisers

Back
Top