when I want to make a selected text as Bold , I should use this code :
edit.document.execCommand("bold", false, "");
But how can i make the align of the text is right , left or center using execCommand ?
execCommand cannot be used for aligning the elements on the page. However you may take a look at commands like Justify or Indent if it will serve your purpose
edit.document.execCommand("JustifyRight", false, "");
https://developer.mozilla.org/en/docs/Web/API/Document/execCommand http://codepen.io/netsi1964/full/QbLLGW/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With