JAVASCRIPT考试题目.pdf_第1页
JAVASCRIPT考试题目.pdf_第2页
JAVASCRIPT考试题目.pdf_第3页
JAVASCRIPT考试题目.pdf_第4页
JAVASCRIPT考试题目.pdf_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

复习题复习题 一 选择题一 选择题 1 写 Hello World 的正确 javascript 语法是 A A document write Hello World B Hello World C response write Hello World D Hello World 2 JS 特性不包括 D A 解释性B 用于客户端C 基于对象D 面向对象 3 下列 JS 的判断语句中 是正确的 A A if i 0 B if i 0 C if i 0 thenD if i 0 then 4 下列 JavaScript 的循环语句中 是正确的 D A if i 10 i B for i 0 i 10 C for i 1 to 10D for i 0 i 10 i 5 下列的哪一个表达式将返回假 B A 3 4 while x 2 要使 while 循环体执行 10 次 空白处的循环判定 式应写为 C A x 10B x 10C x 20D x 20 8 JS 语句 B var a1 10 var a2 20 alert a1 a2 a1 a2 将显示 结果 A a1 a2 30B a1 a2 1020C a1 a2 a1 a2 9 将字串 s 中的所有字母变为小写字母的方法是 B A s toSmallCase B s toLowerCase C s toUpperCase D s toUpperChars 10 以下 表达式产生一个 0 7 之间 含 0 7 的随机整数 C A Math floor Math random 6 B Math floor Math random 7 C Math floor Math random 8 D Math ceil Math random 8 11 产生当前日期的方法是 C A Now B Date C new Date D new Now 12 如果想在网页显示后 动态地改变网页的标题 C A 是不可能的B 通过 document write 新的标题内容 C 通过 document title 新的标题内容 D 通过 document changeTitle 新的标题内容 13 某网页中有一个窗体对象 其名称是 mainForm 该窗体对象的第一个元素是按钮 其名称 是 myButton 表述该按钮对象的方法是 B A document forms myButtonB document mainForm myButton C document forms 0 element 0 D 以上都可以 14 HTML 文档的树状结构中 标签为文档的根节点 位于结构中的最顶层 A A B C D 15 在 HTML 页面中 CSS 样式的属性名为 background image 对应的 style 对象的属性名是 B A backgroundB backgroungImage C image D background 16 在使用 Javascript 实现省市级联菜单功能时 在添加城市列表前清空原来的下拉选项的 代码是 C A document myform selCity options clear B document myform selCity options deleteAll C document myform selCity options length 0 D document myform selCity options size 0 17 HMTL 表单的首要标记是 标记的参数 method 表示表单发送的方法 可能 为 get 或 post 下列关于 get 和 post 的描述正确的是 D A post 方法传递的数据对客户端是不可见的 B get 请求信息以查询字符串的形式发送 查询字符串长度没有大小限制 C post 方法对发送数据的数量限制在 255 个字符之内 D get 方法传递的数据对客户端是不可见的 18 在 DOM 对象模型中 下列选项中的 对象位于 DOM 对象模型的第二层 选择二 项 AB A history B document C button D text 19 在 HTML 文档对象模型中 history 对象的 用于加载历史列表中的下一个 URL 页面 C A next B back C forward D go 1 20 在 Javascript 中要改变页面文档的背景色 需要修改 document 对象的 属性 C A BackColorB BackgroundColorC BgColorD Background 21 在 HTML 页面中 不能与 onChange 事件处理程序相关联的表单元素有 D A 文本框B 复选框C 列表框D 按钮 22 在 HTML 页面上编写 Javascript 代码时 应编写在 标签中间 B A 和 B 和 C 和 D 和 23 在 Javascript 浏览器对象模型中 window 对象的 属性用来指定浏览器状态栏中显示 的临时消息 A A statusB screenC historyD document 24 编写 Javascript 函数实现网页背景色选择器 下列选项中正确的是 B A function change color window bgColor color B function change color document bgColor color C function change color body bgColor color D function change color form bgColor color 25 在 Javascript 中 可以使用 Date 对象的 方法返回一个月中的每一天 A A getDateB getYearC getMonthD getTime 26 在 Javascript 中 对于浏览器对象的层次关系理解正确的是 选择二项 AD A window 对象是所有页面内容的根对象 B document 对象包含 location 对象和 history 对象 C location 对象包含 history D document 对象包含 form 对象 27 下列选项中关于浏览器对象的说法错误的是 C A history 对象记录了用户在一个浏览器中已经访问过的 URLs B location 对象相当于 IE 浏览器中的地址栏 包含关于当前 URL 地址的信息 C location 对象是 history 对象的父对象 D location 对象是 window 对象的子对象 28 在 HTML 页面中包含一个按钮控件 mybutton 如果要实现点击该按钮时调用已定义的 Javascript 函数 compute 要编写的 HTML 代码是 D A B C D 29 分析下面的 Javascript 代码段 输出结果是 C var mystring I am a student var a mystring substring 9 13 document write a A studB tudenC udenD udent 30 Javascript 中制作图片代替按钮的提交效果需要手动提交方法 submit 以下调用正确的 是 C A submit B myform submit C document myform submit D window myform submit 31 在 HTML 页面中包含如下所示代码 则编写 Javascript 函数判断是否按下键盘上的回车 键正确的编码是 C A function myKeyDown if window keyCode 13 alert 你按下了回车键 B function myKeyDown if document keyCode 13 alert 你按下了回车键 C function myKeyDown if event keyCode 13 alert 你按下了回车键 D function myKeyDown if keyCode 13 alert 你按下了回车键 32 如果在 HTML 页面中包含如下图片标签 则选项中的 语句能够实现隐藏该图片的 功能 D A document getElementById pic style display visible B document getElementById pic style display disvisible C document getElementById pic style display block D document getElementById pic style display none 33 如果在 HTML 页面中包含如下图片标签 则在下划线处添加 代码能够实现隐藏该 图片的功能 D A style display visible B style display disvisible C style display block D style display none 34 下列选项中 段 HTML 代码所表示的 返回 链接能够正确实现 IE 工具栏中 后 退 按钮的功能 选择二项 AD A 返回 B 返回 C 返回 D 返回 35 在 HTML 文档中包含如下超链接 要实现当鼠标移入该链接时 超链接文本大小变为 30px 选项中的编码正确的是 C A 注册 B 注册 C 注册 D 注册 36 在 HTML 页面上 当按下键盘上的任意一个键时都会触发 Javascript 的 事件 D A onFocusB onBlurC onSubmitD onKeyDown 37 在 HTML 页面中 定义了如下所示的 Javascript 函数 则正确调用该函数的 HTML 代 码是 选择二项 AB function compute op alert op A B C D 38 在 HTML 页面上包含如下创建层的语句 那么编写 Javascript 语句实现显示该层的语句 错误的是 D A document getElementByTagName div 0 style display block B document getElementById imageLayer style display block C document getElementByName imageLayer 0 style display block D document getElementByName imageLayer get 0 style display block 39 分析下面的 Javascript 代码段 输出结果是 C var s1 parseInt 101 中学 document write s1 A NaNB 101 中学C 101D 出现脚本错误 40 在 HTML 中 点击图片 previous gif 上的超级链接后页面将加载历史列表中的上一个 URL 页面 代码如下所示 应在下划线处填入 A A javascript history go 1 B history go 1 C history go 1 D javascript history go 1 41 在HTML页 面 上 包 含 如 下 所 示 的 层 对 象 则javascript语 句 document getElementById info innerHTML 的值是 A 请填写 A 请填写 B 请填写C id info style display block D 请填写 42 以下哪条语句会产生运行错误 A A varobj B varobj C varobj D var obj 二 阅读程序写结果二 阅读程序写结果 1 function replaceStr inStr oldStr newStr var rep inStr while rep indexOf oldStr 1 rep rep replace oldStr newStr return rep alert replaceStr how do you do do are 答 弹出警示对话框 显示 how are you are 2 var x y null alert x alert y alert x y alert x y 答 依次弹出四个警示对话框 分别显示 undefined null null true 3 x a y b z false function testOne var x c var y d z true alert x alert y alert z function testTwo alert x alert y alert z testOne testTwo 答 依次弹出六个警示对话框 分别显示 c d true a b true 4 当单击 button 按钮时 出现什么结果 Untitled Document function add var first document myForm first value var second parseInt document myForm second value var third parseInt document myForm third value alert first second third 答 弹出警示对话框 显示 403070 三 编写程序三 编写程序 1 实现在标题栏和状态栏上动态显示当前时间的效果 新建网页 1 function showTime now new Date display now toLocaleString document title display status display setTimeout showTime 1000 2 交换图像 3 改变下拉列表框的选项时能显示当前选项的文本和值 1 2 3 function sel obj alert 显示文本 obj options obj selectedIndex text alert 值 obj options obj selectedIndex value 4 要求能够弹出对话框提示当前选中的是第几个单选框 Function foo va

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论