HTML DOM Pre Object

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

HTML <tr> align Attribute

Example Right-align the content of all the cells in the second table row: <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr align=”right”> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » Definition and Usage The align attribute specifies the horizontal alignment of the content in a table row. Browser Support Attribute align Yes Yes Yes Yes Yes Note: None of […]

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 <button> name Attribute

Example Two buttons with equal names, that submit different values when clicked: <form action=”/action_page.php” method=”get”> Choose your favorite subject: <button name=”subject” type=”submit” value=”HTML”>HTML</button> <button name=”subject” type=”submit” value=”CSS”>CSS</button> </form> Try it Yourself » Definition and Usage The name attribute specifies the name for a <button> element. The name attribute is used to reference form-data after the form has been submitted, or to reference the […]

HTML <area> target Attribute

Example An image-map, with clickable areas, and a target attribute: <img src=”planets.gif” width=”145″ height=”126″ alt=”Planets” usemap=”#planetmap”> <map name=”planetmap”> <area shape=”rect” coords=”0,0,82,126″ href=”sun.htm” alt=”Sun” target=”_blank”> <area shape=”circle” coords=”90,58,3″ href=”mercur.htm” alt=”Mercury”> <area shape=”circle” coords=”124,58,8″ href=”venus.htm” alt=”Venus”> </map> Try it Yourself » Definition and Usage The target attribute specifies where to open the linked document. Only used if the href attribute is present. Browser Support Attribute target Yes Yes Yes Yes Yes Differences Between HTML […]

HTML <area> rel Attribute

Example An image-map, with a clickable area: <img src=”planets.gif” width=”145″ height=”126″ alt=”Planets” usemap=”#planetmap”> <map name=”planetmap”> <area shape=”rect” coords=”0,0,82,126″ alt=”Sun” href=”sun.htm” rel=”alternate”> </map> Try it Yourself » Definition and Usage The rel attribute specifies the relationship between the current document and the linked document. Only used if the href attribute is present. Browser Support Attribute rel Yes Yes Yes Yes Yes Differences Between HTML 4.01 and […]

HTML <area> shape Attribute

Example An image-map, with clickable areas: <img src =”planets.gif” width=”145″ height=”126″ alt=”Planets” usemap=”#planetmap”> <map name=”planetmap”> <area shape=”rect” coords=”0,0,82,126″ href=”sun.htm” alt=”Sun”> <area shape=”circle” coords=”90,58,3″ href=”mercur.htm” alt=”Mercury”> <area shape=”circle” coords=”124,58,8″ href=”venus.htm” alt=”Venus”> </map> Try it Yourself » Definition and Usage The shape attribute specifies the shape of an area. The shape attribute is used together with the coords attribute to specify the size, shape, and placement of an area. Browser Support Attribute shape Yes Yes Yes Yes […]

HTML <a> target Attribute

Example The target attribute specifies where to open the linked document: <a href=”https://dwfaisalabad.com” target=”_blank”>Visit DW Fsd</a> Try it Yourself » Definition and Usage The target attribute specifies where to open the linked document. Syntax <a target=”_blank|_self|_parent|_top|framename“> Attribute Values Value Description _blank Opens the linked document in a new window or tab _self Opens the linked […]

HTML <a> coords Attribute

Example Use of the shape and coords attribute in an <a> element, to create an image-map: <object data=”planets.gif” alt=”Planets” type=”image/gif” usemap=”#Map1″> <map name=”Map1″> <a href=”sun.htm” shape=”rect” coords=”0,0,82,126″>The Sun</a> <a href=”mercur.htm”shape=”circle” coords=”90,58,3″>Mercury</a> <a href=”venus.htm” shape=”circle” coords=”124,58,8″>Venus</a> </map> </object> Try it Yourself » Definition and Usage The <a> coords attribute is not supported in HTML5. The coords attribute is used together with the shape attribute to specify the size, shape, and placement […]