JS learning day9

Today is the ninth day of the JS learning, prior learning is learned JS DOM, three parts BOM, ECMAscript composition, came into contact with the DOM and BOM today.

DOM - document object model (Document Object Model) is simply document the contents of the operation object page elements such as access, modify elements, create elements, page content and all related behaviors can be classified into the DOM. How DOM method to get all the elements of today to understand the five, namely to get by id, name tag and name attribute elements, select elements based on a selector, and select all the elements according to the selector. At present, I will only use ID get the elements, the method is documen.getElementById ().

After obtaining his element To change the CSS style, pay attention if the property consists of several words, there are two ways for writing such as box.style.backgroundColor = "# 000" or box.style [background-color] = "# f000 "

There are DOM document object, it is the window of the property, due to the special nature of the window should have been written window.xxx, window can be omitted.

BOM can do many things, such as: Gets the browser viewport size, modify the address bar of the browser, can be operated by history BOM, you can set the timer delay, you can get information about the browser, you can close the page and so on . There are three methods operating history, forward, back, go. The first two were to make a record forward and backward once, let the record can go forward and back refreshed, if go parameter is positive, said forward several times, several times a negative number indicates Back

Guess you like

Origin www.cnblogs.com/mizuno0237/p/11426525.html