Fundamentals of Front End Development MCQs with Answers
Practice important Fundamentals of Front End Development MCQs with answers and explanations.
Multiple Choice Questions
Q1491: Which of the following is a best practice for file names in HTML5?
- A: Use mixed case file names
- B: Use lowercase file names
- C: Use uppercase file names
- D: Use camelCase file names
View Answer
B
Q1492: What is the best practice for adding metadata in HTML5?
- A: Add metadata in the body tag
- B: Add metadata in the head tag
- C: Metadata is optional
- D: Metadata should be added after the body tag
View Answer
B
Q1493: What is the purpose of the HTML <canvas> element?
- A: To create forms
- B: To draw graphics
- C: To insert images
- D: To style text
View Answer
B
Q1494: Fill in the blank: The <canvas> element is used to draw graphics on the fly via _______.
- A: CSS
- B: HTML
- C: JavaScript
- D: PHP
View Answer
C
Q1495: Which attribute is necessary to reference a canvas element in a script?
- A: name
- B: class
- C: id
- D: data
View Answer
C
Q1496: Fill in the blank: The size of the canvas is defined using the _______ and _______ attributes.
- A: width, height
- B: style, size
- C: length, breadth
- D: scale, size
View Answer
A
Q1497: What method is used to get the drawing context of a canvas?
- A: getContext("3d")
- B: getContext("2d")
- C: getContext("drawing")
- D: getContext("canvas")
View Answer
B
Q1498: Which of the following is the correct method to draw a filled rectangle on a canvas?
- A: drawRect(x,y,width,height)
- B: fillRectangle(x,y,width,height)
- C: fillRect(x,y,width,height)
- D: drawFilledRect(x,y,width,height)
View Answer
C
Q1499: Fill in the blank: The _______ method is used to fill a rectangle with color on the canvas.
- A: strokeRect()
- B: fillStyle()
- C: fillRect()
- D: drawRect()
View Answer
C
Q1500: What value does ctx.fillStyle represent in the given code: ctx.fillStyle = "#FF0000";
- A: Border color
- B: Background color
- C: Text color
- D: Fill color
View Answer
D