1. Multiple choice questions (3 questions in total, 30.0 points)
-
(Multiple choice, 10.0 points)
What are the main aspects of creating dynamic HTML through JavaScript? ( ).
A JavaScript is able to change all HTML elements in the page.
B JavaScript can change all HTML attributes in the page.
C JavaScript can change all CSS styles in the page.
D JavaScript can respond to all events in the page. -
(Multiple choice, 10.0 points)
There are ( ) common methods for document objects to obtain HTML element objects.
A getElementById()
B getElementsByName()
C getElementsByTagName()
D getBoundingClientRect() -
(Multiple choice, 10.0 points)
In the canvas, use the ( ) method to draw the rectangle border and fill the rectangle.
A strokeRect()
B stroke()
C fillRect()
D fill()
2. Multiple choice questions (4 questions in total, 40.0 points)
-
(Single-choice question, 10.0 points)
To get the coordinates of an element in the page, use the element's ( ) method.
A getRect
B getBoundingClientRect()
C getContext
D get -
(Single-choice question, 10.0 points)
HTML5 provides ( ) tags, so that users can draw freely on the web page.
A img
B image
C canvas
D background-image -
(Single-choice question, 10.0 points)
The method of cutting an area of any shape and size from the original canvas is ( ).
A drawImage
B arc()
C clip()
D restore() -
(Single-choice question, 10.0 points)
The basic steps of canvas drawing graphics are ( ).
① Create canvas, ② Prepare brush, ③ Start path planning, ④ Move starting point, ⑤ Draw line, ⑥ Close path, ⑦ Draw stroke
A ①②③④⑤⑦⑥
B ②①③④⑤⑥⑦
C ①②③④⑤⑥⑦
D ①②③⑤④⑥⑦
3. True or false questions (3 questions in total, 30.0 points)
-
(True or false, 10.0 points)
After using the lineTo() method to draw a line on the canvas with a brush, the line will be displayed on the canvas.
A pair
B wrong -
(True or false, 10.0 points)
To draw a complex path, you must use the path start (context.beginPath()) and path end (context.closePath()) for path planning.
A pair
B wrong -
(True or false, 10.0 points)
Cannot draw a picture on the canvas.
A pair
B wrong