Create a Bdo Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Bdo

Introduction

You can create a <bdo> element by using the document.createElement() method:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">create a BDO element</button>

<script>
function myFunction() {//  ww w  .ja v a 2s .c  o  m
    var x = document.createElement("BDO");
    var t = document.createTextNode("This text will go right-to-left.");
    x.setAttribute("dir", "rtl");
    x.appendChild(t);
    document.body.appendChild(x);
}
</script>

</body>
</html>

Related Tutorials