0

I am having a style for font in my htm file FONT{ font-size:11px; } which will be loaded initially when my htm loads Now I would like to change the font-size using the following command document.execCommand("fontsize", "", "5"); After execution Now the font tag consists of the attribute size = "5" But I could see font-size:11px still in Current styles of IE Developer toolbar. So the font is not changed.

How to change the font size Please help.

Jagadesh
  • 6,489
  • 8
  • 29
  • 30
  • See this [question][1] [1]: http://stackoverflow.com/questions/5868295/document-execcommand-and-fontsize-in-pixels – NeilC Apr 13 '12 at 09:40

1 Answers1

0

This may be late, but I suggest trying document.execCommand('fontsize,false,'5'). In some browsers, not passing false to defaultUI (the second argument) results in the command not running.

What does it return when you run it? execCommand will return true/false based on success or failure.

ampersand
  • 4,264
  • 2
  • 24
  • 32