HTML <meta> Attributes

HTML <meta> charset Attribute Example Specify the character encoding for the HTML document: <head> <meta charset=”UTF-8″> </head> Try it Yourself » Definition and Usage The charset attribute specifies the character encoding for the HTML document. Tip: The charset attribute can be locally overridden using the lang attribute on any element. HTML <meta> content Attribute Example Describe metadata within an HTML document: […]

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

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

HTML <main> Tag

Example <main> <h1>Web Browsers</h1> <p>Google Chrome, Firefox, and Internet Explorer are the most used browsers today.</p><article> <h1>Google Chrome</h1> <p>Google Chrome is a free, open-source web browser developed by Google, released in 2008.</p> </article><article> <h1>Internet Explorer</h1> <p>Internet Explorer is a free web browser from Microsoft, released in 1995.</p> </article> <article> <h1>Mozilla Firefox</h1> <p>Firefox is a free, […]

HTML <link> Attribute

HTML <link> charset Attribute Example The charset attribute indicates that the linked document is written in Japanese: <link href=”domoarigato.htm” rel=”parent” charset=”ISO-2022-JP”> Definition and Usage The <link> charset attribute is not supported in HTML5. The charset attribute specifies the character encoding of the linked document. The default character-set for modern browsers is ISO-8859-1. Syntax <link charset=”character_set”> Attribute Values Value Description character_set […]

HTML DOM Label Object

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

HTML <input> Type Attribute Values

HTML <input type=”button”> Example A push button that activates a JavaScript when it is clicked: <input type=”button” value=”Click me” onclick=”msg()”> Try it Yourself HTML <input type=”checkbox”> Example Let the user select one or more options of a limited number of choices: <input type=”checkbox” name=”vehicle1″ value=”Bike”> I have a bike<br> <input type=”checkbox” name=”vehicle2″ value=”Car”> I have a car<br> <input type=”checkbox” name=”vehicle3″ value=”Boat” checked> I have a boat<br> Try it Yourself » HTML <input type=”color”> Example […]

HTML <input> type Attribute

Example An HTML form with two different input types; text and submit: <form action=”/action_page.php”> Username: <input type=”text” name=”usrname”><br> <input type=”submit” value=”Submit”> </form> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The type attribute specifies the type of <input> element to display. The default type is text. Tip: The type attribute is not a required attribute, but we […]

HTML <input> align Attribute

Example An HTML form with an image as a submit button. The submit button is aligned to the right: <form action=”/action_page.php”> First name: <input type=”text” name=”fname”><br> <input type=”image” src=”submit.gif” alt=”Submit” align=”right” width=”48″height=”48″> </form> Try it Yourself » Definition and Usage The align attribute is only used with <input type=”image”> and it specifies the alignment of the image input according to surrounding elements. Browser Support […]

HTML <iframe> longdesc Attribute

Example Point to a page with a long description of the content of the <iframe>: <iframe src=”https://dwfaisalabad.com” width=”500″ height=”300″ longdesc=”DW.txt”> </iframe> Try it Yourself » Definition and Usage The <iframe> longdesc attribute is not supported in HTML5. The longdesc attribute specifies a URL to a page that contains a long description of the content of […]

HTML <iframe> srcdoc Attribute

Example An <iframe> with a srcdoc attribute: <iframe srcdoc=”<p>Hello world!</p>” src=”demo_iframe_srcdoc.htm”></iframe> Try it Yourself » Definition and Usage The srcdoc attribute specifies the HTML content of the page to show in the inline frame. Tip: This attribute is expected to be used together with the sandbox and seamless attributes. If a browser supports the srcdoc attribute, it […]

HTML <iframe> src Attribute

Example An <iframe> in its simplest use: <iframe src=”https://dwfaisalabad.com”></iframe> Try it Yourself » Definition and Usage The src attribute specifies the address of the document to embed in the <iframe>. Browser Support Attribute src Yes Yes Yes Yes Yes Differences Between HTML 4.01 and HTML5 NONE. Syntax <iframe src=”URL“> Attribute Values Value Description URL Specifies the […]

HTML <iframe> scrolling Attribute

Example An <iframe> with scrollbars: <iframe src=”/default.asp” width=”300″ height=”300″ scrolling=”yes”> </iframe> Try it Yourself » Definition and Usage The <iframe> scrolling attribute is not supported in HTML5. Use CSS instead. The scrolling attribute specifies whether or not to display scrollbars in an <iframe>. Normally, scrollbars appear in an <iframe> when the content is larger than the <iframe>. Browser Support […]

HTML <iframe> sandbox Attribute

Example An <iframe> with extra restrictions: <iframe src=”sandbox.htm” sandbox></iframe> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The sandbox attribute enables an extra set of restrictions for the content in the iframe. When the sandbox attribute is present, and it will: treat the content as being from a unique origin block form […]

HTML <iframe> name Attribute

Example An <iframe> that act as a target for a link: <iframe src=”demo_iframe.htm” name=”iframe_a”></iframe> <a href=”https://dwfaisalabad.com” target=”iframe_a”> Visit DW </a> Try it Yourself » Definition and Usage The name attribute specifies a name for the <iframe>. This name attribute can be used to reference the element in a JavaScript, or as the value of the target attribute of an […]

HTML <iframe> marginheight and marginwidth Attribute

Example An <iframe> with a top and bottom margin of 50 pixels: <iframe src=”demo_iframe.htm” marginheight=”50″ marginwidth=”50″> </iframe> Try it Yourself » Definition and Usage The <iframe> marginheight and marginwidth attribute is not supported in HTML5. Use CSS instead. The marginheight and marginwidth attribute specifies the top and bottom margins  and left and right of the content of an <iframe> […]

HTML <iframe> height and width Attribute

Example An <iframe> with a specified height and width of 200 pixels: <iframe src=”/default.asp” width=”200″ height=”200″> </iframe> Try it Yourself » Definition and Usage The height attribute specifies the height of an <iframe>, in pixels and the width attribute specifies the width of an <iframe>, in pixels. Browser Support Attribute height and width Yes Yes Yes Yes Yes […]

HTML <iframe> frameborder Attribute

Example An <iframe> with no borders: <iframe src=”/default.asp” width=”200″ height=”200″ frameborder=”0″> </iframe> Try it Yourself » Definition and Usage The <iframe> frameborder attribute is not supported in HTML5. Use CSS instead. The frameborder attribute specifies whether or not to display a border around an <iframe>. Tip: It may be better to NOT specify a frameborder, and use CSS to apply borders instead. […]

HTML <iframe> align Attribute

Example A right-aligned <iframe>: <iframe src=”/default.asp” width=”300″ height=”300″ align=”right”> </iframe> Try it Yourself » Definition and Usage The align attribute specifies the alignment of an <iframe> according to the surrounding element. The <iframe> element is an inline element (it does not insert a new line on a page), meaning that text and other elements can wrap around it. Therefore, […]

HTML <iframe> Tag

Example An inline frame is marked up as follows: <iframe src=”https://dwfaisalabad.com”></iframe> Try it Yourself » Definition and Usage The <iframe> tag specifies an inline frame. An inline frame is used to embed another document within the current HTML document. Browser Support Element <iframe> Yes Yes Yes Yes Yes Tips and Notes Tip: To deal with browsers that […]