HTML <li> Tag

Example One ordered (<ol>) and one unordered (<ul>) HTML list: <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol><ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The <li> tag defines a list item. The <li> tag is used in ordered lists(<ol>), unordered lists (<ul>), and in menu lists (<menu>). […]

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 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 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 DOM Details Object

Details Object The Details object represents an HTML <details> element. Note: The <details> element is not supported in Internet Explorer. Access a Details Object You can access a <details> element by using getElementById(): Example var x = document.getElementById(“myDetails”); Try it Yourself » Create a Details Object You can create a <details> element by using the document.createElement() method: […]

HTML DOM Del Object

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

HTML <ins> Tag

Example A text with a deleted part, and a new, inserted part: <p>My favorite color is <del>blue</del> <ins>red</ins>!</p> Try it Yourself » Definition and Usage The <ins> tag defines a text that has been inserted into a document. Tip: Also look at the <del> tag to markup deleted text. Browsers will normally strike a line through deleted text and underline […]

HTML DOM Datalist Object

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

HTML <colgroup> width Attribute

Example A <colgroup> element that specifies that the first column should have a predefined width of 200 pixels: <table> <colgroup width=”200″> <tr> <th>Month</th> <th>Savings</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 width attribute specifies the width of a column group. Normally, a column group takes […]

HTML DOM Code Object

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

HTML <kbd> Tag

Example Format text in a document: <kbd>Keyboard input</kbd> Try it Yourself » Definition and Usage The <kbd> tag is a phrase tag. It defines keyboard input. Tip: This tag is not deprecated, but it is possible to achieve richer effect with CSS. All phrase tags: Tag Description <em> Renders as emphasized text <strong> Defines important text […]

HTML <samp> Tag

Example Format text in a document: <samp>Sample output from a computer program</samp> Try it Yourself » Definition and Usage The <samp> tag is a phrase tag. It defines sample output from a computer program. Tip: This tag is not deprecated, but it is possible to achieve richer effect with CSS. All phrase tags: Tag Description <em> […]

HTML DOM Cite Object

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

HTML DOM Caption Object

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

HTML <form> method Attribute

Example Submit a form using the “get” method: <form action=”/action_page.php” method=”get”> First name: <input type=”text” name=”fname”><br> Last name: <input type=”text” name=”lname”><br> <input type=”submit” value=”Submit”> </form> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute). The form-data can be sent as URL […]

HTML <form> novalidate Attribute

Example Indicate that the form is not to be validated on submit: <form action=”/action_page.php” novalidate> E-mail: <input type=”email” name=”user_email”> <input type=”submit”> </form> Try it Yourself » Definition and Usage The novalidate attribute is a boolean attribute. When present, it specifies that the form-data (input) should not be validated when submitted. Browser Support The numbers in the table specify the first browser […]

HTML <form> target Attribute

Example Display the response received in a new window or tab: <form action=”/action_page.php” method=”get” target=”_blank”> First name: <input type=”text” name=”fname”><br> Last name: <input type=”text” name=”lname”><br> <input type=”submit” value=”Submit”> </form> Try it Yourself » Definition and Usage The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. The target attribute defines a name of, […]

HTML <form> enctype Attribute

Example Send form-data encoded as “multipart/form-data”: <form action=”/action_page_binary.asp” method=”post” enctype=”multipart/form-data”> First name: <input type=”text” name=”fname”><br> Last name: <input type=”text” name=”lname”><br> <input type=”submit” value=”Submit”> </form> Try it Yourself » Definition and Usage The enctype attribute specifies how the form-data should be encoded when submitting it to the server. Note: The enctype attribute can be used only if method=”post”. Browser Support Attribute enctype Yes Yes Yes Yes Yes Differences […]