JavaScript Lessson 1

JavaScript Introduction

Lesson 2

Notes:

onclick="" Event Attribute:

  • The onclick attribute fires on a mouse click on the element.

document Object:

  • The document object represents your web page.

getElementById() Method:

  • The getElementById() method returns the element that has the ID attribute with the specified value.

innerHTML() Property:

  • The innerHTML property sets or returns the HTML content (inner HTML) of an element.

<script> tag:

  • The <script> tag is used to define a client-side script (JavaScript).

Style Property:

  • The style property returns a CSSStyleDeclaration object, which represents an element's style attribute.

color Property:

  • The color property sets or returns the color of the text.

var Statement:

  • The var statement declares a variable.

getElementsByClassName() Method:

  • The getElementsByClassName() method returns a collection of an element's child elements with the specified class name, as a NodeList object.

backgroundColor Property:

  • The backgroundColor property sets or returns the background color of an element.

return Statement:

  • The return statement stops the execution of a function and returns a value from that function.