<html> <head> <script> function boom() { var het = document.createTextNode(String.fromCharCode(0x05D7)); // hebrew letter het document.getElementById("s").appendChild(het); } </script> </head> <body onload="boom();" dir="rtl"> <div><span id="s">A</span><span> </span>B</div> </body> </html>