Please see this tutorial
http://www.devguru.com/features/tuto...g/wysiwyg2.asp
Now I want add a button for RTL and LTR please help me
| SitePoint Sponsor |



Please see this tutorial
http://www.devguru.com/features/tuto...g/wysiwyg2.asp
Now I want add a button for RTL and LTR please help me





I am stabbing in the dark here, but wouldn't you be able to use
or just use setAttribute('DIR','RTL') on the element you want to apply it to.Code:iview.document.getElementsByTagName('HTML')[0].setAttribute('DIR','RTL'); // or iview.document.getElementsByTagName('HTML')[0].setAttribute('DIR','LTR');
Last edited by gRoberts; Sep 20, 2007 at 03:13.



what is getElementsByTagName('HTML') ?





lol isn't it obvious? maybe not.
getElementsByTagName will get all instances of the supplied tag, in our case HTML within the containg element, in our case the document wysiwyg.
Although i've just noticed i made a mistake within my code, which will has been corrected.
getElementsByTagName returns an array, and I should be selecting the first item within the array.



thank you
I found better way : .execCommand('dirRTL', false, null);
.execCommand('dirLTR', false, null);
Bookmarks