
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Bdo object
The HTML DOM Bdo object is associated with the <bdo> element in HTML. The bdo stands for Bi-Directional Override. It is used for creating and accessing a bdo object. It has only one property “dir”. The text direction by default is left to right but can be overridden with the <bdo> element. The bdo object represents the <bdo> element.
properties
Following is the bdo object property −
Property | Description |
---|---|
dir | Sets or returns the value of the dir attribute of a <bdo> element |
Syntax
Following is the syntax for −
Creating a bdo object −
var a = document.createElement("BDO");
Accessing a bdo object −
var a = document.getElementById("demoBdo");
Example
Let us see an example for HTML DOM bdo object −
<!DOCTYPE html> <html> <body> <p>Click the below button to create bdo element with text from right to left</p> <button onclick="bdoCreate()">CREATE</button> <button onclick="getDirection()">GET DIRECTION</button> <br><br> <p id="Sample"></p> <script> function bdoCreate() { var x = document.createElement("BDO"); var t = document.createTextNode("RIGHT TO LEFT"); x.setAttribute("dir", "rtl"); x.setAttribute("id","myBDO"); x.appendChild(t); document.body.appendChild(x); } function getDirection(){ var x= document.getElementById("myBDO").dir; document.getElementById("Sample").innerHTML="The direction is from"+x; } </script> </body> </html>
Output
This will produce the following output −
On clicking the CREATE button −
On clicking the GET DIRECTION button −
- Related Articles
- HTML DOM Bdo dir Property
- HTML DOM Object Object
- HTML DOM HTML Object
- HTML DOM Ins Object
- HTML DOM HR Object
- HTML DOM Variable Object
- HTML DOM aside Object
- HTML DOM Anchor Object
- HTML DOM TableData Object
- HTML DOM TableHeader Object
- HTML DOM TableRow Object
- HTML DOM Textarea Object
- HTML DOM Meter Object
- HTML DOM MouseEvent Object
- HTML DOM Nav Object

Advertisements