View Full Version : Text align not working JavaScript

11-03-2012, 05:13 PM
I want that when the user click on a button, the text align to the center.. This function of document.execCommand is supported to all browsers, but do not know if the syntax is correwct. Here the function below:

function centeralign() {
lol.document.execCommand('formatDoc', false, 'justifycenter');

Not sure what is wrong... Other document.execcomand functions are working well, except this one...alignment...

11-03-2012, 06:21 PM
nevermind im wrong. jsut been along time since ive seen anyone use it

11-03-2012, 07:07 PM
'justifycenter', false, null works