JavaScript usage Tips Daquan

Source: Internet
Author: User
Tags function definition

1.document.write (""); Output statement

The annotation in 2.JS is//

3. Traditional HTML Document order is:document->html-> (head,body)

4. The DOM order in a browser window is:window-> (navigator,screen,history,location,document)

5. Get the name and value of the element in the form: document.getElementById ("ID number of the element in the form"). Name (or value)

6. A lowercase capitalization JS:document.getElementById ("Output"). Value = document.getElementById ("I

Nput "). Value.touppercase ();

Value type in 7.JS: string,number,boolean,null,object,function

The character type in 8.JS converts to a numeric type: parseint (), parsefloat ()

Converts numbers in 9.JS to character type: ("" + variable)

The length of the string in 10.JS is: (length)

The characters in 11.JS are connected with the character story using the + sign.

The comparison operators in 12.JS are: = = equals,!= not equal, >,>=,<.<=

13.JS declaring variable use: var to declare

Judgment statement structure in 14.JS: if (condition) {}else{}

Loop structure in 15.JS: for ([Initial expression];[ Condition]; [Upadte expression]) {Inside loop}

16. The order of the circular abort is: break

function definition in 17.JS: function functionname ([parameter],...)

18. When multiple form forms appear in a file, they can be replaced with document.forms[0],document.forms[1].

19. Window: Open Window window.open (), close a window: window.close (), window itself: Self

20. Status bar setting: window.status= "character";

21. Pop-up Message: Window.alert ("character");

22. Pop-up Confirmation Box: window.confirm ();

Related Article

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.