View on GitHub

reading-notes

https://samahabujwaied.github.io/reading-notes/

What is an OPJECT (JavaScript)

JavaScript is designed on a simple object-based paradigm. An object is a collection of properties, and a property is an association between a name (or key) and a value. … In addition to objects that are predefined in the browser, you can define your own objects

Creating an OPJECT :Literal notation

Creating an OBJECT: constructor notation

How can you create object in js ?

Accessing an OBJECT and dot notation & Bracket notation

Document OBJECT model

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.

THE DOM TREE IS A MODEL OF A WEB PAGE

DOM tree

WORKING WITH THE DOM TREE

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.

Methods that select indibidual elements

SELECTING ELEMENTS BY TAG NAME

SELECTING ELEMENTS USING CSS SELECTORS

Repeating actions for an entire nodelist

Looping through a nodelist

TRAVERSING THE DOM

HOW TO GET/UPDATE ELEMENT CONTENT

ACCESS & UPDATE TEXT & MARKUP WITH INNERHTML

ADDING ELEMENTS USING DOM MANIPULATION

COMPARING TECHNIQUES: UPDATING HTML CONTENT

DEFENDING AGAINST CROSS-SITE SCRIPTING

CHECK FOR AN ATTRIBUTE AND GET ITS VALUES

REMOVING ATTRIBUTES JS

GOOD LUCK