bunnyali2013 Posted November 3, 2012 Share Posted November 3, 2012 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 correct. 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... Link to comment https://forums.phpfreaks.com/topic/270253-text-align-not-working-javascriptpt/ Share on other sites More sharing options...
hell_yeah Posted November 3, 2012 Share Posted November 3, 2012 Hi, I guess it should be this way: function centeralign() { lol.document.execCommand('justifycenter', false, null); }; Link to comment https://forums.phpfreaks.com/topic/270253-text-align-not-working-javascriptpt/#findComment-1389960 Share on other sites More sharing options...
bunnyali2013 Posted November 3, 2012 Author Share Posted November 3, 2012 thank its working Link to comment https://forums.phpfreaks.com/topic/270253-text-align-not-working-javascriptpt/#findComment-1389966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.