title: How to view Print result RTL
body: <p>When i print text in textarea it shows LTR and my text is RTL so how can i fix this problem so the text will show up like is it left or right or center and i have another problem when i copy text area it aligns to right but sometime i have certain words in the center and they move to right in the text editor area</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html "&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;!-- script print button --&gt;
   &lt;script type="text/javascript"&gt;
        function printTextArea() {
      
          childWindow = window.open('','childWindow','location=yes, menubar=yes, toolbar=yes');
          childWindow.document.open();
          childWindow.document.write('&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;');
          childWindow.document.write(document.getElementById('targetTextArea').value.replace(/\n/gi,'&lt;br&gt;'));
          childWindow.document.write('&lt;/body&gt;&lt;/html&gt;');
          childWindow.print();
          childWindow.document.close();
          childWindow.close();
        }
      &lt;/script&gt;
  &lt;style type="text/css"&gt;
  textarea {
  direction: rtl; 
   background-color: white;
   font-size: 1em;
   font-weight: bold;
   font-family: Verdana, Arial, Helvetica, sans-serif;
   border: 1px solid black;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;p&gt;
      &lt;TEXTAREA name="thetext" rows="20" cols="80"id="targetTextArea" &gt;&lt;/TEXTAREA&gt;
     &lt;/p&gt;
     &lt;!-- print button --&gt;
    &lt;center&gt; &lt;input type="button" onclick="printTextArea()" value="طباعة"/&gt;&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>