title: How can I change all div elements dir from LTR to RTL upon language selection?
body: <p>What is the best way to change all div elements based on a language selection?</p>
  
  <p>My scenario - viewing a web page in English, then changing to a right to left type language,</p>
  
  <p>I want to add dir="rtl" on the fly and remove it or change it to dir="ltr" when a left to right type language is selected.</p>
  
  <p>For example </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;div dir="ltr"&gt;</code></pre>
  </div>
  </div>
  </p>