title: how to get HTML direction property as a alert (RTL)
body: <p>I am working rtl right to left direction.  I want to know how to get dir value in alert using javascript.</p>
  
  <p>Here is my html code</p>
  
  <pre><code>&lt;html dir="rtl"&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my javascript code</p>
  
  <pre><code>alert(document.getElementsByTagName("html")[0]);
  </code></pre>
  
  <p>I am not getting the alert as dir ="rtl".</p>
  
  <p>Based on the direction I have to do some condition checking. Instead of attribute is there any way please help me</p>
  
  <p>Please help me how to get that tag name.</p>
  
  <p>Regards
  M</p>