javascript
html语言入门测试题,Web前端:20道非常基础的JavaScript测试题
1.我們可以在下列哪個 HTML 元素中放置 Javascript 代碼?()
A.
B.
C.
D.
2.寫 "Hello World" 的正確 Javascript 語法是?()
A.("Hello World")
B."Hello World"
C.response.write("Hello World")
D.document.write("Hello World")
3.插入 Javacript 的正確位置是?()
A.
部分B.
部分C.
部分和部分均可4.引用名為 "xxx.js" 的外部腳本的正確語法是?()
A.
B.
C.
5.如何在警告框中寫入 "Hello World"?()
A.alertBox="Hello World"
B.msgBox("Hello World")
C.alert("Hello World")
D.alertBox("Hello World")
6.如何創建函數?()
A.function:myFunction()
B.function myFunction()
C.function=myFunction()
7.如何調用名為 "myFunction" 的函數?()
A.call function myFunction
B.call myFunction()
C.myFunction()
8.如何編寫當 i 等于 5 時執行一些語句的條件語句?()
A.if (i==5)
B.if i=5 then
C.if i=5
D.if i==5 then
9.如何編寫當 i 不等于 5 時執行一些語句的條件語句?()
A.if =! 5 then
B.if >< 5
C.if (i >< 5)
D.if (i != 5)
10.在 JavaScript 中,有多少種不同類型的循環?()
A.兩種。for 循環和 while 循環。
B.四種。for 循環、while 循環、do...while 循環以及 loop...until 循環。
C.一種。for 循環。
11.for 循環如何開始?()
A.for (i <= 5; i++)
B.for (i = 0; i <= 5; i++)
C.for (i = 0; i <= 5)
D.for i = 1 to 5
12.如何在 JavaScript 中添加注釋?()
A.' This is a comment
B.
C.//This is a comment
順便給大家推薦一個裙,它的前面是 537,中間是631,最后就是 707。想要學習前端的小伙伴可以加入我們一起學習,互相幫助。群里每天晚上都有大神免費直播上課,如果不是想學習的小伙伴就不要加啦。(537631707)
13.可插入多行注釋的 JavaScript 語法是?()
A./*This comment has more than one line*/
B.//This comment has more than one line//
C.
14.定義 JavaScript 數組的正確方法是?()
A.var txt = new Array="George","John","Thomas"
B.var txt = new Array(1:"George",2:"John",3:"Thomas")
C.var txt = new Array("George","John","Thomas")
D.var txt = new Array:1=("George")2=("John")3=("Thomas")
15.如何把 7.25 四舍五入為最接近的整數?()
A.round(7.25)
B.rnd(7.25)
C.Math.rnd(7.25)
D.Math.round(7.25)
16.如何求得 2 和 4 中最大的數?()
A.Math.ceil(2,4)
B.Math.max(2,4)
C.ceil(2,4)
D.top(2,4)
17.打開名為 "window2" 的新窗口的 JavaScript 語法是?()
A.open.new("http://www.w3cschool.cn","window2")
B.new.window("http://www.w3cschool.cn","window2")
C.new("http://www.w3cschool.cn","window2")
D.window.open("http://www.w3cschool.cn","window2")
18.如何在瀏覽器的狀態欄放入一條消息?()
A.statusbar = "put your message here"
B.window.status = "put your message here"
C.window.status("put your message here")
D.status("put your message here")
19.如何獲得客戶端瀏覽器的名稱?()
A.client.navName
B.navigator.appName
C.browser.name
20.外部腳本必須包含
A.正確
B.錯誤
請把你的答案寫在留言區。^_^
總結
以上是生活随笔為你收集整理的html语言入门测试题,Web前端:20道非常基础的JavaScript测试题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html循环自动点击事件,js循环遍历u
- 下一篇: gradle idea java ssm