0% found this document useful (0 votes)
8 views

MocktestCOMP1589_SU2024

The document consists of a series of multiple-choice questions related to web development, covering topics such as HTML, CSS, JavaScript, and web protocols. Each question presents four options, with only one correct answer. The questions assess knowledge on syntax, functionality, and best practices in web technologies.

Uploaded by

anhndgch220882
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

MocktestCOMP1589_SU2024

The document consists of a series of multiple-choice questions related to web development, covering topics such as HTML, CSS, JavaScript, and web protocols. Each question presents four options, with only one correct answer. The questions assess knowledge on syntax, functionality, and best practices in web technologies.

Uploaded by

anhndgch220882
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1. What does CSS stand for?

a. Cascading Style Sheets


b. Colored Style Sheets
c. Color and Styles Sheets
d. None of above

2. Inside which HTML elements do we put CSS code?

a. <css>
b. <js>
c. <script>
d. <style>

3. What is the purpose of the DOCTYPE declaration, circle one

a. To specify the character encoding of the HTML document


b. To define the style and layout of the webpage
c. To indicate the version and type of HTML being used
d. To include external JS files in the HTML document

4. HTML stands for -

a. HighText Machine Language


b. HyperTech Markup Language
c. HyperText Markup Language
d. None of these

5. What will be the output of following CSS code snippet?

h1 {color: red text-decoration: underline; font-style: italic;}

a. color: red, text-decoration: underline works


b. only font-style: italic works
c. color: red, text-decoration: underline and font-style: italic all works
d. text-decoration: underline and font-style: italic works

6. How can we make an ordered list in HTML?

e. <ul>
f. <ol>
g. <li>
h. <item>

7. What does HTTP stand for?


a. HyperText Transport Protocol
b. HyperText Transfer Protocol
c. High Transport Protocol
d. High Transfer Protocol

8. What is HSL in the below example stand for

a. Hue Specified Lightness


b. Hue Spot Lightness
c. Hue Saturation Lightness
d. None of the above

9. Which of the following Color Format is a CSS colors can also be defined using the keyword rgb,
followed by three numbers between 0 and 255, contained in parentheses and separated by commas, with
no spaces between them

a. RGB Color
b. RGBa Color
c. HSL Color
d. HSLa Color

10. Which ways can we declare a variable in JS?

a. let
b. var
c. Both are correct
d. None is correct

11. Which the foundation of the web, and it consisted of static text and images?

a. Web1.0
b. Web2.0
c. Web3.0
d. Web3

12. In JS, 7+”10” will output

a. 17
b. 7
c. 10
d. 710

13. What will be the output of the following JavaScript code?

// JavaScript Comparison Operators


function compare()
{
let a=2;
let b=2.0;
if(a==b)
return true;
else
return false;
}

a. False
b. True
c. compilation error
d. runtime error

14. What will be the output of the following JavaScript code?

var quiz=[1,2,3];
var js=[6,7,8];
var result=quiz.concat(js);
document.writeln(result);

a. 1, 2, 3, 6, 7, 8
b. 123678
c. 1, 2, 3
d. Error

15. Small text files that are stored on a user’s computer or device by a website that they are visit and are
used to remember user preferences, login information, and other details that make browsing the web more
convenient are called
a. Session IDs
b. Cookies
c. Browser cache
d. Database records

16. What is the purpose of alt attributes when defining an image in HTML

a. To specify the background color of an image


b. To hyperlink the image to another webpage
c. To define an alternative text description for the image
d. To control the size and dimensions of the image

17. Which JavaScript method is used to write into an alert box?

a. Window.alert()
b. Window.alertBox()
c. Window.alertContent()
d. Window.alertMessage()

18. What is the correct syntax for referring an external CSS?

a. <link rel="stylesheet" type="text/css" href="mystyle.css">


b. <stylesheet rel="stylesheet" type="text/css" href="mystyle.css">
c. <style rel="stylesheet" type="text/css" href="mystyle.css">
d. All of the above

19. To repeat an action in an unpredetermined number of times, you should use

a. For loop
b. While loop
c. Both of the above
d. None of the above

20. CSS comments are placed within the ______.

a. //
b. /* and */
c. <* and *>
d. <! And !>

21. What does the folowing code mean?

h1{text-decoration:underline}

a. Emphasize the text in the level-one heading


b. Underline the text in level-one heading
c. The text in level-one heading will be italic
d. Do nothing

22. Which HTML tag is used to insert an image?

a. <img url=”htmllogo.jpg” />


b. <img alt=”htmllogo.jpg” />
c. <img src=”htmllogo.jpg” />
d. <img link=”htmllogo.jpg” />

23. What is essentially a box that wraps around every HTML element. It consists of: content, padding,
borders and margins

a. HTML Table
b. CSS Flexbox Layout
c. CSS Grid Layout
d. CSS Box Model

24. Which element in HTMl is used to draw the graphic, on the fly, via JS?

a. <graphic>
b. <design>
c. <canvas>
d. <animation>

25. How do we select the element with class ‘demo’?

a. demo
b. .demo
c. #demo
d. <demo>

26. What consists of two or more computers that are linked in order to share resources (such as printers
and CDs), exchange files, or allow electronic communications. The computers on a network may be
linked through cables, telephone lines, radio waves, satellites, or infrared light beams.

a. Social media
b. World Wide Web
c. Network
d. None of above

27. Select a valid variable name in JS

a. last_name
b. last.name
c. last-name
d. last name
28. What will be the output of the following JavaScript code?

<script>
const myArray = ['h', 'e', 'l', 'l', 'o'];

document.write(myArray[1]); document.write(myArray[2]);

</script>

a. he
b. el
c. ValueError
d. TypeError

29. Which HTML tag is used to display a web page within a web page.

a. <li>
b. <a>
c. <web>
d. <iframe>

30. Which HTML tag let a user select ONE of a limited number of choices.

a. <input type=”radio”>
b. <input type=”checkbox”>
c. <input type=”choice”>
d. <input type=”check”>

31. Which JavaScript method is used to write on browser's console?

a. console.write()
b. console.output()
c. console.log()
d. console.writeHTML()

32. Which is the correct syntax to call an external JavaScript file in the current HTML document?

a. <script src="jsfile.js"></script>
b. <script href=" jsfile.js"></script>
c. <import src=" jsfile.js"></import>
d. <script link=" jsfile.js"></script>

33. JSON stands for _______.

a. JavaScript Object Notation


b. Java Object Notation
c. JavaScript Object Normalization
d. JavaScript Object-Oriented Notation
34. Which of the following element is responsible for making the text bold in HTML?

a. <br>
b. <b>
c. <a>
d. <em>

35. Which CSS property is used to change the color of text?

a. background-color
b. text-color
c. color
d. font-color

36. How can you apply a hover effect to an HTML element?

a. Using the :hover pseudo-class in CSS


b. Using the hover attribute in HTML
c. Using the mouseover event in JavaScript
d. Using the active class in HTML

37. Which of the following best describes web accessibility?

a. Making websites accessible only to users with disabilities


b. Designing websites that are usable by a diverse range of people, including those with
disabilities
c. Creating websites that are visually appealing to everyone
d. Ensuring websites load quickly on all devices

38. Which of the following is the correct way to create a button that submits a form when clicked

a. <button type="submit">Submit</button>
b. <input type="button" value="Submit">
c. <button>Submit</button>
d. <a href="#" onclick="submitForm()">Submit</a>

39. Which internet protocol are used in application layer

a. TCP
b. HTTP
c. IP
d. Ethernet

40. Which JavaScript object is commonly used to perform AJAX requests?


a. XMLHttpRequest
b. JSONRequest
c. AJAXRequest
d. HTTPConnection

You might also like