在JavaScript中要改变页面文档的背景色,需要修改document对象的________________属性。

admin2020-05-13  17

问题 在JavaScript中要改变页面文档的背景色,需要修改document对象的________________属性。

选项 A、  BackColor
B、  BackgroundColor
C、  BgColor
D、  Background

答案C

解析 本题考查JavaScript中document对象的使用方法。
Javascript中document对象常用的方法和属性如下:
对象属性:
document.title    //设置文档标题等价于HTML的<title>标签
document.bgCofor    //设置页面背景色
document.fgColor    //设置前景色(文本颜色)
document.linkColor    //未单击过的链接颜色
document.alinkColor    //激活链接(焦点在此链接上)的颜色
document.vlinkColor    //已单击过的链接颜色
document.URL    //设置URL属性从而在同一窗口打开另一网页
document.fileCreatedDate    //文件建立日期,只读属性
document.fileModifiedDate  //文件修改日期,只读属性
document.fileSize    //文件大小,只读属性
document.cookie    //设置和读出cookie
document.charset    //设置字符集简体中文:gb2312
常用对象方法:
document.write()    //动态向页面写入内容
document.createElement(Tag)    //创建一个html标签对象
document.qetElementById(ID)    //获得指定ID值的对象
document.getElementsByName(Name)    //获得指定Name值的对象
转载请注明原文地址:https://kaotiyun.com/show/89WZ777K
0

最新回复(0)