JavaScript Beginner Essays

Source: Internet
Author: User
Tags javascript extension tag name

  two commonly used representations : JavaScript is a scripting language that must be placed between <script></scirpt> and can be placed in <body> or

Preferably put in

  semicolon (;): Java is not the same as JavaScript, and Java does not add semicolons to the dead. Javasript is optional, preferably plus. ( But the case sensitivity is the same )

  document.getElementById ("); Use the script statement to access an HTML element (the element to be accessed is identified with an ID, otherwise a browser incompatibility problem will occur)

  document.getElementsByTagName ("); : Can return a collection with the specified tag name, return more, the elder brother is a SLR (very expensive.) Okay, don't make a mistake.

  document.write (): Output content to the file (the entire HTML page will be overwritten if the document has been loaded and executed after the command is completed)

  function: (equivalent to Java method?) ) keyword function

  var: variable (unlike Java, he can become dynamic, one will be a string or a Boolean)

  className : Returns the class attribute of the element because it is the same keyword as Java, remember it.

  window.onload: When the document is loaded, everything inside will be loaded. I learned Window.onload=funciton today.

} JS has a benefit, so write not to write the name of the evil (equivalent to anonymous inner class?). )

if () {}for () {}while () {}switch () {}

JS in order to change the HTML of an attribute can only be changed, or to use the loop traversal.

JavaScript Beginner Essays

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.