JavaScript模拟试题一、单选题1.我们可以在下列哪个HTML元素中放置Javascript代码?<script><javascript><js><scripting>2.写"HelloWorld"的正确Javascript语法是?("HelloWorld")"HelloWorld"("HelloWorld")("HelloWorld")3.插入Javacript的正确位置是?<body>部分<head>部分<body>部分和<head>部分均可4.引用名为""的外部脚本的正确语法是?<scriptsrc=""><scripthref=""><scriptname="">.外部脚本必须包含<script>标签吗?是否如何在警告框中写入"HelloWorld"?alertBox="HelloWorld"msgBox("HelloWorld")alert("HelloWorld")alertBox("HelloWorld")7.如何创建函数?function:myFunction()functionmyFunction()function=myFunction()8.如何调用名为"myFunction"的函数?callfunctionmyFunctioncallmyFunction()myFunction()9.如何编写当i等于5时执行一些语句的条件语句?if(i==5)ifi=5thenifi=5ifi==?=!5thenif<>5if(i<>5)if(i!=5),有多少种不同类型的循环?两种。for循环和while循环。四种。for循环、while循环、do...while循环以及loop...until循环。一种。for循环。?for(i<=5;i++)for(i=0;i<=5;i++)for(i=0;i<=5)fori=?'ment<!--ment-->//?/*menthasmorethanoneline*///menthasmorethanoneline//<!--menthasmorethanoneline-->?vartxt=newArray="e","John","Thomas"vartxt=newArray(1:"e",2:"John",3:"Thomas")vartxt=newArray("e","John","Thomas")vartxt=newArray:1=("e")2=("John")3=("Thomas")?round()rnd()C.()()?(2,4)(2,4)ceil(2,4)top(2,4)"window2"的新窗口的JavaScript语法是?("","window2")("","window2")new("","window2")("","window2")?statusbar="putyourmessagehere"="putyourmessagehere"("putyourmessagehere")status("putyourmessagehere")?(A)....,应尽量使用(B)。,控制弹出窗口的位置(A)。控制事件冒泡(A)。.("countDown();",1000);表示(D)。....每隔1分种调用countDown函
javascript模拟试题 来自淘豆网www.taodocs.com转载请标明出处.