HTML DOM Strong Object

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

HTML DOM Mark Object

Mark Object  The Mark Object is new in HTML5. The Mark object represents an HTML <mark> element. Note: The <mark> element is not supported in Internet Explorer 8 and earlier versions. Access a Mark Object You can access a <mark> element by using getElementById(): Example var x = document.getElementById(“myMark”); Try it Yourself » Create a Mark Object […]

HTML DOM Figcaption Object

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

HTML <track> kind Attribute

Example A video with two subtitle tracks: <video width=”320″ height=”240″ controls> <source src=”forrest.mp4″ type=”video/mp4″> <track src=”subtitles_en.vtt” kind=”subtitles” srclang=”en” label=”English”> <track src=”subtitles_no.vtt” kind=”subtitles” srclang=”no” label=”Norwegian”> </video> Definition and Usage The kind attribute specifies the kind of text track. Browser Support The numbers in the table specify the first browser version that fully supports the attribute. Attribute kind 18.0 10.0 31.0 6.0 15.0 Differences Between HTML 4.01 and HTML5 The […]

HTML <track> default Attribute

Example A video with two subtitle tracks. “English” subtitle is the default: <video width=”320″ height=”240″ controls> <source src=”forrest.mp4″ type=”video/mp4″>  <track src=”subtitles_en.vtt” kind=”subtitles” srclang=”en” label=”English” default> <track src=”subtitles_no.vtt” kind=”subtitles” srclang=”no” label=”Norwegian”> </video> Definition and Usage The default attribute is a boolean attribute. When present, it specifies that the track is to be enabled if the user’s preferences do not indicate that another track would be more appropriate. Note: There must not […]

HTML <track> Tag

Example A video with two subtitle tracks: <video width=”320″ height=”240″ controls> <source src=”forrest.mp4″ type=”video/mp4″>  <track src=”subtitles_en.vtt” kind=”subtitles” srclang=”en” label=”English”> <track src=”subtitles_no.vtt” kind=”subtitles” srclang=”no” label=”Norwegian”> </video> Definition and Usage The <track> tag specifies text tracks for media elements (<audio> and <video>). This element is used to specify subtitles, caption files or other files containing text, that should be visible when the media is playing. Browser Support The numbers in […]

HTML <dir> Tag

Not Supported in HTML5 Example A directory list: <dir> <li>html</li> <li>xhtml</li> <li>css</li> </dir> Try it Yourself » Definition and Usage The <dir> tag is not supported in HTML5. Use <ul> or CSS instead. The <dir> tag is used to list directory titles. Browser Support Element <dir> Yes Yes Yes Yes Yes Tips and Notes Tip: Use CSS to […]

HTML DOM DFN Object

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

HTML <dfn> Tag

Example Mark up the defining instance of a term: <p><dfn>HTML</dfn> is the standard markup language for creating web pages.</p> Try it Yourself » Definition and Usage The <dfn> tag represents the defining instance of a term in HTML. The defining instance is often the first use of a term in a document. The nearest parent of […]

HTML <colgroup> char Attribute

Example In the example below, the content of the second column should be aligned to the “.” character: <table style=”width:100%”> <colgroup align=”left”></colgroup> <colgroup align=”char” char=”.”></colgroup> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100.00</td> </tr> <tr> <td>February</td> <td>$10.00</td> </tr> </table> Try it Yourself » Definition and Usage The <colgroup> char attribute is not supported in HTML5. The char attribute specifies the […]

HTML Headings

Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 HTML Headings Headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading. Example <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> Try it Yourself » Note: Browsers automatically add some white space (a margin) before and […]

HTML Elements

An HTML element usually consists of a start tag and end tag, with the content inserted in between: <tagname>Content goes here…</tagname> The HTML element is everything from the start tag to the end tag: <p>My first paragraph.</p> Start tag Element content End tag <h1> My First Heading </h1> <p> My first paragraph. </p> <br> HTML elements with no content are called […]