JS Getting Started

Source: Internet
Author: User
Tags button type

JS is JavaScript, scripting language

I will learn some of the following aspects of learning

    • Write HTML output

Document.writer ("

    • Respond to Events

<button type = "button" onclick = "alert (' welcome! ')" > Click here </button>;

Alert () can be used for code testing and debugging

    • Change HTML content

<! DOCTYPE html>
<body>

<p id= "Demo" >
JavaScript can change the content of HTML elements.
</p>

<script>
function myFunction ()
{
X=document.getelementbyid ("demo"); Find element
X.innerhtml= "Hello javascript!"; Change Content
}
</script>

<button type= "button" onclick= "myFunction ()" > click here </button>

</body>

document.getElementById ("some id") is a method defined in the HTML DOM

The DOM is the Document Object model and is the official standard for accessing HTML elements.

    • changing HTML images
    • Change HTML style
    • Validate input
    • such as

Tip: JavaScript and Java are two completely different languages, both conceptually and in design.

Java (invented by Sun) is a more complex programming language.

ECMA-262 is the official name of the JavaScript standard.

JavaScript was invented by Brendan Eich. It appeared in Netscape in 1995 (the browser has stopped updating) and was adopted by the ECMA (a standard association) in 1997.

JS Getting Started

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.