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

web technology

The document contains a series of multiple-choice questions (MCQs) related to web technologies, covering HTML, CSS, JavaScript, PHP, and web security. Each question is followed by four answer options, with the correct answer indicated. Topics include HTML tags, CSS properties, JavaScript syntax, PHP functions, and web security concepts like XSS and SQL Injection.

Uploaded by

rdeebikame
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

web technology

The document contains a series of multiple-choice questions (MCQs) related to web technologies, covering HTML, CSS, JavaScript, PHP, and web security. Each question is followed by four answer options, with the correct answer indicated. Topics include HTML tags, CSS properties, JavaScript syntax, PHP functions, and web security concepts like XSS and SQL Injection.

Uploaded by

rdeebikame
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Web Technology - MCQ with Answers

1. Which tag is used to create a hyperlink?


a) <link>
b) <a>
c) <href>
d) <hlink>
Answer: b) <a>

2. What is the correct way to create a checkbox in HTML?


a) <checkbox>
b) <input type="checkbox">
c) <check>
d) <input checkbox>
Answer: b) <input type="checkbox">

3. Which tag is used for the largest heading?


a) <h6>
b) <h3>
c) <h1>
d) <head>
Answer: c) <h1>

4. What is the default file extension for an HTML document?


a) .doc
b) .html
c) .css
d) .js
Answer: b) .html

5. Which tag is used to define an unordered list?


a) <ol>
b) <ul>
c) <li>
d) <list>
Answer: b) <ul>

6. Which of the following is NOT a valid HTML5 element?


a) <article>
b) <section>
c) <footer>
d) <navbar>
Answer: d) <navbar>

7. How do you insert a line break in HTML?


a) <br>
b) <lb>
c) <break>
d) <line>
Answer: a) <br>
8. The <title> tag must be placed inside which HTML element?
a) <head>
b) <body>
c) <footer>
d) <title>
Answer: a) <head>

9. Which HTML tag is used to display a table?


a) <tr>
b) <table>
c) <td>
d) <tab>
Answer: b) <table>

10. Which attribute is used to specify an image's alternate text?


a) alt
b) title
c) src
d) text
Answer: a) alt

2. CSS (Cascading Style Sheets)

11. What is the correct syntax for referring to an external CSS file?
a) <stylesheet> style.css </stylesheet>
b) <style src="style.css">
c) <link rel="stylesheet" type="text/css" href="style.css">
d) <css> style.css </css>
Answer: c) <link rel="stylesheet" type="text/css" href="style.css">

12. Which property is used to change the font color of text?


a) font-color
b) text-color
c) color
d) font-style
Answer: c) color

13. Which CSS property controls the text size?


a) font-style
b) text-size
c) font-size
d) size
Answer: c) font-size

14. How do you make text bold in CSS?


a) text-weight: bold;
b) font-style: bold;
c) font-weight: bold;
d) text-bold: true;
Answer: c) font-weight: bold;

15. How do you select an element with the id "header"?


a) #header
b) .header
c) header
d) *header
Answer: a) #header

3. JavaScript

16. What is the correct syntax for a JavaScript alert box?


a) alert("Hello!");
b) msg("Hello!");
c) alertBox("Hello!");
d) message("Hello!");
Answer: a) alert("Hello!");

17. What is the correct way to write a JavaScript array?


a) var colors = "red", "green", "blue";
b) var colors = ["red", "green", "blue"];
c) var colors = (1:"red", 2:"green", 3:"blue");
d) var colors = "red"; "green"; "blue";
Answer: b) var colors = ["red", "green", "blue"];

18. Which function is used to parse a string to an integer in JavaScript?


a) parseInt()
b) getInt()
c) intParse()
d) parseNumber()
Answer: a) parseInt()

19. What keyword is used to define a JavaScript function?


a) define
b) func
c) function
d) method
Answer: c) function

20. Which of the following is not a valid JavaScript data type?


a) Number
b) Boolean
c) String
d) Character
Answer: d) Character

4. PHP (Hypertext Preprocessor)


21. PHP scripts are executed on:
a) Client-side
b) Server-side
c) Both client and server
d) None of the above
Answer: b) Server-side

22. What is the correct way to start a PHP script?


a) <?php
b) <script>
c) <php>
d) <?php script>
Answer: a) <?php

23. What does PHP stand for?


a) Personal Home Page
b) Private Hypertext Processor
c) PHP: Hypertext Preprocessor
d) Public HTML Processor
Answer: c) PHP: Hypertext Preprocessor

24. How do you write a single-line comment in PHP?


a) //
b) #
c) /* */
d) Both a and b
Answer: d) Both a and b

25. Which function is used to display text in PHP?


a) print()
b) display()
c) echo()
d) show()
Answer: c) echo()

5. Web Security

26. What does XSS stand for?


a) XML Secure Scripting
b) Cross-Site Scripting
c) Extended Secure Sockets
d) Cross Server Security
Answer: b) Cross-Site Scripting

27. What is SQL Injection?


a) A method to optimize SQL queries
b) A web security vulnerability
c) A database management technique
d) A JavaScript library
Answer: b) A web security vulnerability

28. What is the main purpose of HTTPS?


a) To speed up a website
b) To make a website more interactive
c) To provide encrypted communication
d) To track website traffic
Answer: c) To provide encrypted communication

1. HTML (HyperText Markup Language)

29. What does HTML stand for?


a) Hyperlinks and Text Markup Language
b) HyperText Markup Language
c) Home Tool Markup Language
d) Hyperlinking Text Markup Language
Answer: b) HyperText Markup Language

30. Which of the following is the correct file extension for an HTML file?
a) .htm
b) .html
c) Both a and b
d) .web
Answer: c) Both a and b

31. Which tag is used to define a hyperlink in HTML?


a) <link>
b) <a>
c) <href>
d) <hlink>
Answer: b) <a>

32. Which HTML tag is used for inserting an image?


a) <image>
b) <img>
c) <pic>
d) <photo>
Answer: b) <img>

33. Which of the following is a block-level element?


a) <span>
b) <div>
c) <b>
d) <i>
Answer: b) <div>

34. What does HTML stand for?


a) Hyperlinks and Text Markup Language
b) HyperText Markup Language
c) Home Tool Markup Language
d) Hyperlinking Text Markup Language
Answer: b) HyperText Markup Language

35. Which of the following is the correct file extension for an HTML file?
a) .htm
b) .html
c) Both a and b
d) .web
Answer: c) Both a and b

36. Which tag is used to define a hyperlink in HTML?


a) <link>
b) <a>
c) <href>
d) <hlink>
Answer: b) <a>

37. Which HTML tag is used for inserting an image?


a) <image>
b) <img>
c) <pic>
d) <photo>
Answer: b) <img>

38. Which of the following is a block-level element?


a) <span>
b) <div>
c) <b>
d) <i>
Answer: b) <div>

39. What does HTML stand for?


a) Hyperlinks and Text Markup Language
b) HyperText Markup Language
c) Home Tool Markup Language
d) Hyperlinking Text Markup Language
Answer: b) HyperText Markup Language

40. Which of the following is the correct file extension for an HTML file?
a) .htm
b) .html
c) Both a and b
d) .web
Answer: c) Both a and b

41. Which tag is used to define a hyperlink in HTML?


a) <link>
b) <a>
c) <href>
d) <hlink>
Answer: b) <a>
42. Which HTML tag is used for inserting an image?
a) <image>
b) <img>
c) <pic>
d) <photo>
Answer: b) <img>

43. Which of the following is a block-level element?


a) <span>
b) <div>
c) <b>
d) <i>
Answer: b) <div>

44. What does CSS stand for?


a) Computer Style Sheets
b) Creative Style Sheets
c) Cascading Style Sheets
d) Colorful Style Sheets
Answer: c) Cascading Style Sheets

45. Which property is used to change the background color in CSS?


a) color
b) bgcolor
c) background-color
d) background
Answer: c) background-color

46. Which CSS property is used to make the text bold?


a) font-weight
b) bold
c) font-style
d) text-weight
Answer: a) font-weight

47. Which is the correct way to apply an external CSS file?


a) <link rel="stylesheet" type="text/css" href="style.css">
b) <stylesheet> style.css </stylesheet>
c) <css> style.css </css>
d) <style src="style.css">
Answer: a) <link rel="stylesheet" type="text/css" href="style.css">

48. How can you make a list not display bullet points?
a) list-style-type: none;
b) text-decoration: none;
c) display: none;
d) remove-bullets: true;
Answer: a) list-style-type: none;

49. Which keyword is used to declare a variable in JavaScript?


a) var
b) let
c) const
d) All of the above
Answer: d) All of the above

50. How do you write a comment in JavaScript?


a) // This is a comment
b) /* This is a comment */
c) Both a and b
d) # This is a comment
Answer: c) Both a and b

51. Which method is used to display a message in an alert box?


a) alertBox()
b) msgBox()
c) alert()
d) message()
Answer: c) alert()

52. How do you define a function in JavaScript?


a) function myFunction() {}
b) def myFunction() {}
c) func myFunction() {}
d) method myFunction() {}
Answer: a) function myFunction() {}

53. Which event occurs when a user clicks an HTML element?


a) onmouseover
b) onclick
c) onchange
d) onhover
Answer: b) onclick

54. What is the default port for HTTP?


a) 21
b) 80
c) 443
d) 8080
Answer: b) 80

55. Which protocol is used for secure communication over the web?
a) HTTP
b) HTTPS
c) FTP
d) SMTP
Answer: b) HTTPS

56. Which DNS record type is used to point a domain to an IP address?


a) CNAME
b) A
c) MX
d) TXT
Answer: b) A

57. What does FTP stand for?


a) File Transfer Protocol
b) File Transmission Protocol
c) Fast Transfer Protocol
d) File Tracking Protocol
Answer: a) File Transfer Protocol

58. Which of the following is not a valid HTTP method?


a) GET
b) POST
c) DELETE
d) FETCH
Answer: d) FETCH

59. What is the default port for HTTP?


a) 21
b) 80
c) 443
d) 8080
Answer: b) 80

60. Which protocol is used for secure communication over the web?
a) HTTP
b) HTTPS
c) FTP
d) SMTP
Answer: b) HTTPS

61. Which DNS record type is used to point a domain to an IP address?


a) CNAME
b) A
c) MX
d) TXT
Answer: b) A

62. What does FTP stand for?


a) File Transfer Protocol
b) File Transmission Protocol
c) Fast Transfer Protocol
d) File Tracking Protocol
Answer: a) File Transfer Protocol

63. Which of the following is not a valid HTTP method?


a) GET
b) POST
c) DELETE
d) FETCH
Answer: d) FETCH
64. What is SQL Injection?
a) A method to speed up SQL queries
b) A web security vulnerability
c) A database optimization technique
d) A type of JavaScript attack
Answer: b) A web security vulnerability

65. What does XSS stand for?


a) XML Secure Scripting
b) Cross-Site Scripting
c) Extended Secure Sockets
d) Cross Server Security
Answer: b) Cross-Site Scripting

66. What is the purpose of CAPTCHA?


a) To prevent automated bot access
b) To speed up website loading
c) To increase website ranking
d) To secure database access
Answer: a) To prevent automated bot access

67. What is HTTPS used for?


a) Encrypting website data
b) Compressing website files
c) Hosting images
d) Running JavaScript faster
Answer: a) Encrypting website data

68. What is a firewall?


a) A security system that monitors network traffic
b) A hardware device for increasing internet speed
c) A website designing tool
d) A database management system
Answer: a) A security system that monitors network traffic

69. Which tag is used to create a hyperlink? a) <link>


b) <a>
c) <href>
d) <hlink>
Answer: b) <a>

70. What is the correct way to create a checkbox in HTML? a) <checkbox>


b) <input type="checkbox">
c) <check>
d) <input checkbox>
Answer: b) <input type="checkbox">

71. Which tag is used for the largest heading? a) <h6>


b) <h3>
c) <h1>
d) <head>
Answer: c) <h1>

72. What is the default file extension for an HTML document? a) .doc
b) .html
c) .css
d) .js
Answer: b) .html

73. Which tag is used to define an unordered list? a) <ol>


b) <ul>
c) <li>
d) <list>
Answer: b) <ul>

74. Which of the following is NOT a valid HTML5 element? a) <article>


b) <section>
c) <footer>
d) <navbar>
Answer: d) <navbar>

75. How do you insert a line break in HTML? a) <br>


b) <lb>
c) <break>
d) <line>
Answer: a) <br>

76. The <title> tag must be placed inside which HTML element? a) <head>
b) <body>
c) <footer>
d) <title>
Answer: a) <head>

77. Which HTML tag is used to display a table? a) <tr>


b) <table>
c) <td>
d) <tab>
Answer: b) <table>

78. Which attribute is used to specify an image's alternate text? a) alt


b) title
c) src
d) text
Answer: a) alt

79. What is the correct syntax for referring to an external CSS file? a) <stylesheet> style.css
</stylesheet>
b) <style src="style.css">
c) <link rel="stylesheet" type="text/css" href="style.css">
d) <css> style.css </css>
Answer: c) <link rel="stylesheet" type="text/css" href="style.css">
80. Which property is used to change the font color of text? a) font-color
b) text-color
c) color
d) font-style
Answer: c) color

81. Which CSS property controls the text size? a) font-style


b) text-size
c) font-size
d) size
Answer: c) font-size

82. How do you make text bold in CSS? a) text-weight: bold;


b) font-style: bold;
c) font-weight: bold;
d) text-bold: true;
Answer: c) font-weight: bold;

83. How do you select an element with the id "header"? a) #header


b) .header
c) header
d) *header
Answer: a) #header

84. What is the correct syntax for a JavaScript alert box? a) alert("Hello!");
b) msg("Hello!");
c) alertBox("Hello!");
d) message("Hello!");
Answer: a) alert("Hello!");

85. What is the correct way to write a JavaScript array? a) var colors = "red", "green", "blue";
b) var colors = ["red", "green", "blue"];
c) var colors = (1:"red", 2:"green", 3:"blue");
d) var colors = "red"; "green"; "blue";
Answer: b) var colors = ["red", "green", "blue"];

86. Which function is used to parse a string to an integer in JavaScript? a) parseInt()


b) getInt()
c) intParse()
d) parseNumber()
Answer: a) parseInt()

87. What keyword is used to define a JavaScript function? a) define


b) func
c) function
d) method
Answer: c) function

88. Which of the following is not a valid JavaScript data type? a) Number
b) Boolean
c) String
d) Character
Answer: d) Character

89. PHP scripts are executed on: a) Client-side


b) Server-side
c) Both client and server
d) None of the above
Answer: b) Server-side
90. What is the correct way to start a PHP script? a) <?php
b) <script>
c) <php>
d) <?php script>
Answer: a) <?php
91. What does PHP stand for? a) Personal Home Page
b) Private Hypertext Processor
c) PHP: Hypertext Preprocessor
d) Public HTML Processor
Answer: c) PHP: Hypertext Preprocessor
92. Which tag is used to create a hyperlink? a) <link>
b) <a>
c) <href>
d) <hlink>
Answer: b) <a>
93. What is the correct way to create a checkbox in HTML? a) <checkbox>
b) <input type="checkbox">
c) <check>
d) <input checkbox>
Answer: b) <input type="checkbox">
94. Which tag is used for the largest heading? a) <h6>
b) <h3>
c) <h1>
d) <head>
Answer: c) <h1>
95. What is the default file extension for an HTML document? a) .doc
b) .html
c) .css
d) .js
Answer: b) .html
96. Which tag is used to define an unordered list? a) <ol>
b) <ul>
c) <li>
d) <list>
Answer: b) <ul>
97. Which of the following is NOT a valid HTML5 element? a) <article>
b) <section>
c) <footer>
d) <navbar>
Answer: d) <navbar>
98. How do you insert a line break in HTML? a) <br>
b) <lb>
c) <break>
d) <line>
Answer: a) <br>
99. The <title> tag must be placed inside which HTML element? a) <head>
b) <body>
c) <footer>
d) <title>
Answer: a) <head>
100. Which HTML tag is used to display a table? a) <tr>
b) <table>
c) <td>
d) <tab>
Answer: b) <table>

You might also like