Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    366
    Thanks
    39
    Thanked 0 Times in 0 Posts

    Text align not working JavaScript

    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:

    Code:
    function centeralign() {
        lol.document.execCommand('formatDoc', false, 'justifycenter');
    };
    Not sure what is wrong... Other document.execcomand functions are working well, except this one...alignment...

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    nevermind im wrong. jsut been along time since ive seen anyone use it

  • #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    366
    Thanks
    39
    Thanked 0 Times in 0 Posts
    'justifycenter', false, null works


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •