And the DOM BOM
BOM browser object model
the window.open (URL, '', 'width = 400px, 400px height =')
the window.opener () function can be called sub-page parent page directly by this method
the window.close ()
window.location.href to get the current web page where the url
window.location.href current url = Jump to a specific url
usually a combination of ajax be used with
a timer related
setTimeOut
clearTimeout
setInterval
clearInterval
timer example of
a pop-up
Alert
Confirm the
prompt
the DOM document Object model
the concept of the DOM tree
how to find labels
basic selectors
document.getElementById label object itself
document.getElementsByClassName array
document.getElementsByTagName array of
how to operate the label
variable names to refer to if it is recommended that a label written in the format xxxEle
if referring to a jQuery object is it is recommended that in front of the variable name with a $
eg: p tag
PELE
$ PELE
node operation
document.createElement ( 'name tag')
appendChild
parent tag .insertBefore (newly created label, already has a label)
Sets the label property
custom properties: setAtrribute (): both can be set from defined herein may be provided default
default attributes: attribute name tag disposed directly
obtain the value
.Value
the innerText: text label does not recognize
the innerHTML: text label identifying
classList.remove () >>> removeClass ()
classList.add () >>> . addClass ()
classList.contains >>> hasClass ()
classList.toggle >>> toggleClass ()
light switch exemplary
css operation
style.color
style.fontSize
js binding event
js code writing position
1.window.onload
2. recommended write introducing the bottom body is also true in the external file
light switch exemplary
xxxEle.Event name function = () {
// event code
}
Click event onclick
the INPUT box acquiring / losing focus
the onfocus
onblur
timer
provinces linkage
jQuery
library
$ () jQuery ()
$ (selector) .action (parameters)
The basic selectors
descendant selectors
attribute selectors
native js objects and jQuery object into
jQuery object is similar to an array which is one of the object tags (native objects js)
$ (js native objects) >>> jQuery object
GOOD, DOM
Guess you like
Origin www.cnblogs.com/pangqian/p/11502353.html
Recommended
Ranking