HTML <video> src Attribute

Example Play a video: <video src=”movie.ogg” controls> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The src attribute specifies the location (URL) of the video file. The example above uses an Ogg file, and will work in Firefox, Opera and Chrome. To play the video in Internet Explorer and […]

HTML <video> preload Attribute

Example Author thinks that the video should NOT be loaded when the page loads: <video controls preload=”none”> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The preload attribute specifies if and how the author thinks that the video should be loaded when the page loads. The preload […]

HTML <video> poster Attribute

Example A video player with a poster image: <video controls poster=”/images/w3html5.gif”> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The poster attribute specifies an image to be shown while the video is downloading, or until the user hits the play button. If this is not included, the […]

HTML <video> muted Attribute

Example A muted video: <video controls muted> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The muted attribute is a boolean attribute. When present, it specifies that the audio output of the video should be muted. Browser Support The numbers in the table specify the first browser […]

HTML <video> loop Attribute

Example A video that will start over again, every time it is finished: <video controls loop> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The loop attribute is a boolean attribute. When present, it specifies that the video will start over again, every time it is finished. […]

HTML <video> height Attribute

Example A video player with a specified height and width: <video width=”320″ height=”240″ controls> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The height attribute specifies the height of a video player, in pixels. Tip: Always specify both the height and width attributes for videos. If height and width are […]

HTML <video> controls Attribute

Example A <video> element with browser default controls: <video controls> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The controls attribute is a boolean attribute. When present, it specifies that video controls should be displayed. Video controls should include: Play Pause Seeking Volume Fullscreen toggle Captions/Subtitles (when […]

HTML <video> autoplay Attribute

Example A video that will automatically start playing: <video controls autoplay> <source src=”movie.mp4″ type=”video/mp4″> Your browser does not support the video tag. </video> Try it Yourself » Definition and Usage The autoplay attribute is a boolean attribute. When present, the video will automatically start playing as soon as it can do so without stopping. Browser Support The numbers […]

HTML <wbr> Tag

Example A text with word break opportunities: <p> To learn AJAX, you must be familiar with the XML<wbr>Http<wbr>Request Object. </p> Try it Yourself » Definition and Usage The <wbr> (Word Break Opportunity) tag specifies where in a text it would be ok to add a line-break. Tip: When a word is too long, or you are […]

HTML DOM Emphasized Object

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

HTML DOM DT Object

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

HTML DOM DList Object

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

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 <div> Tag

Example A section in a document that will have a light blue background color: <div style=”background-color:lightblue”> <h3>This is a heading</h3> <p>This is a paragraph.</p> </div> Try it Yourself » Definition and Usage The <div> tag defines a division or a section in an HTML document. The <div> element is often used as a container for other […]

HTML <ul> Tag

Example An unordered HTML list: <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <ul> tag defines an unordered (bulleted) list. Use the <ul> tag together with the <li> tag to create unordered lists. Browser Support Element <ul> Yes Yes Yes Yes Yes Tips and Notes Tip: Use […]

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 Dialog Object

Dialog Object  The Dialog Object is new in HTML5. The Dialog object represents an HTML <dialog> element. Note: The <dialog> element is currently only supported in Chrome 37+, Safari 6+ and Opera 24+. Access a Dialog Object You can access a <dialog> element by using getElementById(): Example var x = document.getElementById(“myDialog”); Try it Yourself » Create a […]

HTML <dialog> Tag

Example Using the <dialog> element: <table> <tr> <th>January <dialog open>This is an open dialog window</dialog></th> <th>February</th> <th>March</th> </tr> <tr> <td>31</td> <td>28</td> <td>31</td> </tr> </table> Try it Yourself » Definition and Usage The <dialog> tag defines a dialog box or window. The <dialog> element makes it easy to create popup dialogs and modals on a web page. Browser […]

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 […]