HTML DOM Small Object

Small Object The Small object represents an HTML <small> element. Access a Small Object You can access a <small> element by using getElementById(): Example var x = document.getElementById(“mySmall”); Try it Yourself » Create a Small Object You can create a <small> element by using the document.createElement() method: Example var x = document.createElement(“SMALL”); Try it Yourself » Standard […]

HTML DOM Progress Object

Progress Object  The Progress Object is new in HTML5. The Progress object represents an HTML <progress> element. The <progress> element represents the progress of a task. Access a Progress Object You can access a <progress> element by using getElementById(): Example var x = document.getElementById(“myProgress”); Try it Yourself » Create a Progress Object You can create a […]

HTML DOM Head Object

Head Object The Head object represents an HTML <head> element. Access a Head Object You can access a <head> element by using getElementsByTagName(): var x = document.getElementsByTagName(“HEAD”)[0]; Create a Head Object You can create a <head> element by using the document.createElement() method: var x = document.createElement(“HEAD”); Standard Properties and Events The Anchor object also supports the standard properties and events.

HTML DOM Heading Object

Heading Object The Heading object represents an HTML heading element: <h1> to <h6>. Access a Heading Object You can access a heading element by using getElementById(): Example var x = document.getElementById(“myHeading”); Try it Yourself » Create a Heading Object You can create a heading element by using the document.createElement() method: Example var x = document.createElement(“H1”); Try it […]

HTML <th> nowrap Attribute

Example A header cell with a nowrap attribute: <table> <tr> <th>Month</th> <th nowrap>My Savings for a new car</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The nowrap attribute is a boolean attribute. When present, it specifies that the content inside a header cell should not wrap. […]

HTML <thead> align Attribute

Example Left-align the content inside the <thead> element: <table> <thead align=”left”> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The align attribute specifies the horizontal alignment of the content inside the <thead> element. Browser Support Attribute align Yes Yes Yes Yes Yes Note: IE […]

HTML DOM Div Object

Div Object The Div object represents an HTML <div> element. Access a Div Object You can access a <div> element by using getElementById(): Example var x = document.getElementById(“myDIV”); Try it Yourself » Create a Div Object You can create a <div> element by using the document.createElement() method: Example var x = document.createElement(“DIV”); Try it Yourself » Div […]

HTML <!DOCTYPE> Declaration

Example <!DOCTYPE html> <html> <head> <title>Title of the document</title> </head><body> The content of the document…… </body></html> Try it Yourself » Definition and Usage The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag. The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser […]

HTML Computer Code Elements

Computer Code <code> x = 5;<br> y = 6;<br> z = x + y; </code> Try it Yourself » HTML <kbd> For Keyboard Input The HTML <kbd> element represents user input, like keyboard input or voice commands. Text surrounded by <kbd> tags is typically displayed in the browser’s default monospace font: Example <p>Save the document by pressing <kbd>Ctrl + S</kbd></p> […]