Html page with jquery and dir=rtl appears blank on chrome Html page with jquery and dir=rtl appears blank on chrome google-chrome google-chrome

Html page with jquery and dir=rtl appears blank on chrome


The attribute dir can be overriden by CSS direction: rtl;, when it comes to content presentation:

As the directionality of the text is semantically related, I suggest you add dir='rtl' in Javascript when jQuery is loaded. That way, dir is not interfering with jQuery when the page is loading.

<html>  <body>    <h1>Blank screen test</h1>    <div style="padding: 50%; background-color: orange;">Hey</div>    <script src="https://code.jquery.com/jquery-1.11.1.js"></script>    <script type="text/javascript">      $(document).ready(function() { $('html').attr('dir', 'rtl'); });    </script>  </body></html>