Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 1.84 KB

Read06.md

File metadata and controls

35 lines (20 loc) · 1.84 KB

WHAT IS AN OBJECT?

Objects group together a set of variables and functions to create a modelof a something you would recognize from the real world. In an object,variables and functions take on new names

  • IN AN OBJECT: VARIABLES BECOME KNOWN AS PROPERTIES
  • IN AN OBJECT: FUNCTIONS BECOME KNOWN AS METHODS

What is the DOM ?

The Document Object Model (DOM) specifies how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window.

Accessing a DOM element By TagName:

1- getElementByTagName

2- getElementByTagName.html

3- getElementByClassName

HOW TO GET/UPDATE ELEMENT CONTENT?

So far this chapter has focused on finding elements in the DOM tree. The rest of this chapter shows how to access/update element content. Your choice of techniques depends upon what the element contains.

ACCESSING AND CHANGING THE HTML PAGE

The DOM also defines methods and properties to access and update each object in this model, which in turn updates what the user sees in the browser.

You will hear people call the DOM an Application Programming Interface (API). User interfaces let humans interact with programs; APls let programs (and scripts) talk to each other. The DOM states what your script can “ask the browser about the current page, and how to tell the browser to update what is being shown to the user.

problem domian

A problem domain is simply looking at only the topics of an individual’s interest, and excluding everything else. For example, when developing a system to measure good practice in medicine, carpet drawings at hospitals would not be included in the problem domain

Accessing and updating the DOM tree involves two steps:

1- Locate the node that represents the element you want to work with.

2- Use its text content, child elements, and attributes.