javascript-BOM page object / DOM object operation tab

#BOM page objects / DOM label object operations

## BOM page object (window can not write)

window.alert ( 'Hello')
Alert ( 'Hello') box shells
window.confirm ( "Cancel / Delete")
Confirm ( "Cancel / Delete") to confirm the warning projectile box returns ture false


id = setInterval (function, time) open counter, every time the time loop is executed a function
the clearInterval (ID) closed counter function into the interior of
the setTimeout (function, time) skips execution function performed again after the sleeping time


Page forward fallback
history.back () returns the url link on this page a page
history.forword () to enter history.back () page of this page

This page navigation bar get url
url = location.hrel

 

## DOM object operation tag

var ele=document.getElementById('id')

内容:
ele.innerHTML
ele.innerTEXT
ele.value

var data = ele.innerHTML # read the content
ele.innerHTML = 'content' content #


Shu_xing:
eleid
eleclassName
eletitle
elesrc

var ti = s.title # title attribute value read
s.title = 'classic' title # modify property values
s.title = null remove
style:
ele.style.color = 'Blue'
s.style.borderBottomColor = '# 666'
s.style.borderTopColor = 'chartreuse

Guess you like

Origin www.cnblogs.com/chenlulu1122/p/11888847.html