Methods for Dhtml_____document objects

Source: Internet
Author: User

1 <HTML> 2 <Head>3 <MetaCharSet= "Utf-8">4     <title>Method of Document Object</title>5 </Head>6 <Body>7 <DivID= "divID"></Div>8 <!-- 9 1. WriteTen Note the method that belongs to the document, not the element label One  - A <Scriptlanguage= "JavaScript"> - document.write ("Hello World"); - document.write ("Hello world<br/>"); the </Script> - <!--  - 2, Writein difference: one more space -  - + <Scriptlanguage= "JavaScript"> - Document.writeln ("Writein"); + Document.writeln ("Writein"); A Document.writeln ("Writein"); at Document.writeln ("Writein"); - document.close (); - </Script> - <!--  - 3, open Document.open () and window.open () the same effect - recommended use of window.open () in  - - <Scriptlanguage= "JavaScript"> to Document.open ("","_blank"); + //window.open ("http://www.baidu.com", "_blank"); - </Script> the <!--  * 4, close after all the content has been written to the newly opened document flow, $ Be sure to call this method to close the document flow,Panax Notoginseng Otherwise, there may be some indeterminate results - imagine the IO stream shutting down every time . the  - + <Scriptlanguage= "JavaScript"> A //document.close (); the </Script> + <!--  - 5. Clear () Clears all content in the document $ has not been fully supported, $ You can use the write (), close () two statement instead -  - - <Scriptlanguage= "JavaScript"> the document.clear (); - </Script>Wuyi <!--  the 6, getElementById ("Id") - cannot have two elements with the same id attribute value Wu  - - <!--  About 7, Getelementsbyname ("") $ returned is an array of -  - - <!--  - 8, getElementsByTagName ("") A returns all of the label names equal to the specified parameters + an array of objects corresponding to the HTML element the  - - <!-- $ 9, document.createelement ("option") the produces an object that represents an HTML element the  - the <!-- the 10, createStyleSheet - It is recommended that you use obj. Classname= "DIV"; in  - the <!-- the 11. About  - the </Body> the </HTML>

Methods for Dhtml_____document objects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.