Understanding Problem domain is the hardest part of programming
To make Programming easy we should understand the problem domain ***********************************
a set of variables and functions to create a model of something from the real world.
Property value can be string, number, Boolean, array or another object.but the value of method is always a function.
Example: var person = { firstName: “John”, lastName: “Doe”, age: 50, eyeColor: “blue” };
Making The HTML Model and With the HTML DOM,JavaScript can access and change all the elements of an HTML document.
DOM Queries: methods to find elements in the DOM tree .
Storing elements in variables = storing the location of the elements in DOM tree. Example : var itemOne = getElementById(‘one’);
DOM queries return one element, or return a Nodelist, which is a collection of nodes.
Example: var myNodelist = document.querySelectorAll(“p”); var i; for (i = 0; i < myNodelist.length; i++) { myNodelist[i].style.color = “red”; }