HTML <strike> Tag

Not Supported in HTML5 Example Strikethrough text can be marked up as follows: <p>Version 2.0 is <strike>not yet available!</strike> now available!</p> Try it Yourself » Definition and Usage The <strike> tag is not supported in HTML5. Use <del> or <s> instead. The <strike> tag defines strikethrough text. Browser Support Element <strike> Yes Yes Yes Yes Yes

HTML <s> Tag

Example Mark up text that is no longer correct: <p><s>My car is blue.</s></p> <p>My new car is silver.</p> Try it Yourself » Definition and Usage The <s> tag specifies text that is no longer correct, accurate or relevant. The <s> tag should not be used to define replaced or deleted text, use the <del> tag to define […]

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

Example How to use the <picture> tag: <picture> <source media=”(min-width: 650px)” srcset=”img_pink_flowers.jpg”> <source media=”(min-width: 465px)” srcset=”img_white_flower.jpg”> <img src=”img_orange_flowers.jpg” alt=”Flowers” style=”width:auto;”> </picture> Try it Yourself » Definition and Usage The <picture> tag gives web developers more flexibility in specifying image resources. The most common use of the <picture> element will be for art direction in responsive designs. Instead of having one image that […]

HTML DOM Parameter Object

Parameter Object The Parameter object represents an HTML <param> element. The <param> element is used to define parameters for plugins embedded with an <object> element. Access a Parameter Object You can access a <param> element by using getElementById(): Example var x = document.getElementById(“myParam”); Try it Yourself » Create a Parameter Object You can create a <param> […]

HTML <p> Tag

Example A paragraph is marked up as follows: <p>This is some text in a paragraph.</p> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <p> tag defines a paragraph. Browsers automatically add some space (margin) before and after each <p> element. The margins can be modified with CSS (with the […]

HTML DOM Output Object

Output Object  The Output Object is new in HTML5. The Output object represents an HTML <output> element. Note: The <output> element is not supported in Internet Explorer / Edge. Access an Output Object You can access an <output> element by using getElementById(): Example var x = document.getElementById(“myOutput”); Try it Yourself » Tip: You can also access an <output> […]

HTML <output> Attributes

HTML <output> for Attribute Perform a calculation and show the result in an <output> element: <form oninput=”x.value=parseInt(a.value)+parseInt(b.value)”>0 <input type=”range” id=”a” value=”50″>100 +<input type=”number” id=”b” value=”50″> =<output name=”x” for=”a b”></output> </form> Try it Yourself » Definition and Usage The for attribute specifies the relationship between the result of the calculation, and the elements used in the calculation. HTML <output> form Attribute An <output> element located outside a form (but […]

HTML <output> Tag

Example Perform a calculation and show the result in an <output> element: <form oninput=”x.value=parseInt(a.value)+parseInt(b.value)”>0 <input type=”range” id=”a” value=”50″>100 +<input type=”number” id=”b” value=”50″> =<output name=”x” for=”a b”></output> </form> Try it Yourself » Definition and Usage The <output> tag represents the result of a calculation (like one performed by a script). Browser Support The numbers in the table specify the first browser version that fully supports […]

HTML DOM Option Object

Option Object The Option object represents an HTML <option> element. Access an Option Object You can access an <option> element by using getElementById(): Example var x = document.getElementById(“myOption”); Try it Yourself » Tip: You can also access an Option object by searching through the elements collection of a form, or the options collection of a drop-down list. Create an Option Object […]

HTML <option> Attributes

HTML <option> disabled Attribute A drop-down list with one disabled option: <select> <option value=”volvo” disabled>Volvo</option> <option value=”saab”>Saab</option> <option value=”vw”>VW</option> <option value=”audi”>Audi</option> </select> Try it Yourself » Definition and Usage The disabled attribute is a boolean attribute. When present, it specifies that an option should be disabled. A disabled option is unusable and un-clickable. The disabled attribute can be set to keep a […]

HTML DOM Summary Object

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

HTML DOM Superscript Object

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

TML <sub> Tag

Example Subscript text: <p>This text contains <sub>subscript</sub> text.</p> Try it Yourself » Definition and Usage The <sub> tag defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O. Tip: Use the <sup> tag to define superscripted text.

HTML <sup> Tag

Example Superscript text: <p>This text contains <sup>superscript</sup> text.</p> Try it Yourself » Definition and Usage The <sup> tag defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW[1]. Tip: Use the <sub> tag to define subscript text. Browser Support Element […]

HTML <svg> Tag

Example Draw a circle: <svg width=”100″ height=”100″> <circle cx=”50″ cy=”50″ r=”40″ stroke=”green” stroke-width=”4″ fill=”yellow” /> </svg> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <svg> tag defines a container for SVG graphics. SVG has several methods for drawing paths, boxes, circles, text, and graphic images. To learn more about SVG, please read our SVG Tutorial. Browser Support Element <svg> […]

HTML <table> Tag

Example A simple HTML table, containing two columns and two rows: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <table> tag defines an HTML table. An HTML table consists of the <table> element and one or more <tr>, <th>, and <td> elements. The […]

HTML DOM Table Object

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

HTML <optgroup> Attributes

HTML <optgroup> disabled Attribute A disabled option-group: <select> <optgroup label=”German Cars” disabled> <option value=”mercedes”>Mercedes</option> <option value=”audi”>Audi</option> </optgroup> </select> Try it Yourself » Definition and Usage The disabled attribute is a boolean attribute. When present, it specifies that an option-group should be disabled. A disabled option-group is unusable and un-clickable. The disabled attribute can be set to keep a user from selecting […]