- open
打開(kāi)窗口 地址 屬性
window.open('http://www.baidu.com',"_self")
- textarea
文本區(qū)中可容納無(wú)限數(shù)量的文本啦粹,其中的文本的默認(rèn)字體是等寬字體(通常是 Courier)。
可以通過(guò) cols 和 rows 屬性來(lái)規(guī)定 textarea 的尺寸,不過(guò)更好的辦法是使用 CSS 的 height 和 width 屬性罐监。
注釋?zhuān)涸谖谋据斎雲(yún)^(qū)內(nèi)的文本行間,用 "%OD%OA" (回車(chē)/換行)進(jìn)行分隔瞒爬。
- write
在新窗口寫(xiě)入東西
var newwindow = window.open('http://www.baidu.com',"_self")
newwindow.document.write('1234567')
- close
關(guān)閉窗口 注意必須是open打開(kāi)的才能關(guān)閉
window.close()
- userAgent
獲取瀏覽器信息
window.navigation.userAgent
- 窗口尺寸 工作區(qū)尺寸
可視化尺寸
document.documentElement.clientWidth
document.documentElement.clientHeight
滾動(dòng)區(qū)域
document.body.scrollTop
document.documentElement.scrollTop
- alert
彈框
alert(1)
- confirm
彈框
jump是true說(shuō)明點(diǎn)擊的確定其他的都是false
let jump = confirm("你好明天")
- prompt
彈框
jump是true說(shuō)明點(diǎn)擊的確定其他的都是false
第一個(gè)參數(shù)是提示文字 第二個(gè)是默認(rèn)值
let jump = prompt("請(qǐng)輸入你的名字",'blue')