Javascript examples for CSS Style Property:direction
Return the text direction of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP" style="direction:rtl;">This is an example paragraph.</p> <button type="button" onclick="myFunction()">Return text direction</button> <script> function myFunction() {/*from ww w . j a v a 2s.c o m*/ console.log(document.getElementById("myP").style.direction); } </script> </body> </html>