<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8">
    <title>Set and unset dir="auto"</title>
    <script type="text/javascript" src="setDir.js"></script>
    <style>
     textarea { resize: none; }
    </style>
  </head>
  <body onload="setAllDirAttribute('rtl')">
    <div><input type="text" value="אבג ABC" id="set0" dir="ltr"></div>
    <div><span id="set1" dir="ltr">אבג ABC</span></div>
    <div><textarea id="set2" dir="ltr">אבג ABC</textarea></div>
    <div><button id="set3" dir="ltr">אבג ABC</button></div>
    <div><bdi id="set4" dir="ltr">אבג ABC</bdi></div>
  </body>
</html>