NEW
Font size
WorksheetsWEB I SEMESTER I - Final Test
Total questions: 50
Worksheet time: 11mins
What does HTML stand for?
a) Hyperlinks and Text Markup Language
b) Home Tool Markup Language
c) Hyper Text Markup Language
d) Hyper Text Machine Language
Which tag is used to create a hyperlink in HTML?
a) <link>
b) <a>
c) <href>
d) <hyperlink>
What is the correct HTML element for the largest heading?
a) <h6>
b) <h1>
c) <head>
d) <heading>
Which attribute is used to specify an alternate text for an image?
a) title
b) src
c) alt
d) href
What is the purpose of the <meta> tag in HTML?
a) To define a paragraph
b) To provide metadata about the document
c) To create a table
d) To insert an image
Which HTML element is used to define an internal style sheet?
a) <css>
b) <script>
c) <style>
d) <link>
What is the correct HTML for inserting a background image?
a) <body background="image.jpg">
b) <background img="image.jpg">
c) <body style="background-image:url('image.jpg')">
d) <img src="image.jpg" background>
Which HTML element is used to define a table row?
a) <td>
b) <tr>
c) <th>
d) <table>
What is the correct HTML for creating a checkbox?
a) <input type="check">
b) <input type="checkbox">
c) <checkbox>
d)<check>
Which HTML5 element is used to define a footer for a document or section?
a) <footer>
b) <bottom>
c) <section>
d) <div>
What does CSS stand for?
a) Computer Style Sheets
b) Cascading Style Sheets
c) Creative Style Sheets
d) Colorful Style Sheets
Which property is used to change the background color in CSS?
a) color
b) bgcolor
c) background-color
d) background
How do you add a comment in CSS?
a) // This is a comment
b) <!-- This is a comment -->
c) /* This is a comment */
d) # This is a comment
Which CSS property controls the text size?
a) font-style
b) font-size
c) text-size
d) text-style
How do you select an element with the ID "header" in CSS?
a) .header
b) #header
c) header
d) *header
Which CSS property is used to change the font of an element?
a) font-family
b) font-style
c) font-weight
d) font-type
What is the default value of the position property in CSS?
a) static
b) relative
c) fixed
d) absolute
Which CSS property is used to create space between the content and the border of an element?
a) margin
b) padding
c) border-spacing
d) spacing
Which CSS property is used to make the text bold?
a) font-weight
b) text-bold
c) font-style
d) text-weight
What is the correct syntax for referring to an external JavaScript file?
a) <script href="script.js">
b) <script src="script.js">
c) <script name="script.js">
d) <script file="script.js">
How do you write "Hello World" in console?
a) alertBox("Hello World");
b) msg("Hello World");
c) alert("Hello World");
d) console.log("Hello World");
Which of the following is NOT a JavaScript data type?
a) String
b) Boolean
c) Number
d) Float
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";
Which operator is used to assign a value to a variable?
a) =
b) ==
c) ===
d) ->
Which CSS property is used to create a responsive grid layout?
a) display: flex;
b) display: grid;
c) display: inline-block;
d) display: table;
What does the z-index property in CSS control?
a) The horizontal position of an element
b) The vertical position of an element
c) The stacking order of elements
d) The opacity of an element
Which method is used to add an element to the end of an array in JavaScript?
a) push()
b) pop()
c) shift()
d) unshift()
What will the following code return: Boolean(10 > 9)?
a) true
b) false
c) NaN
d) undefined
How do you create a function in JavaScript?
a) function:myFunction() {}
b) function myFunction() {}
c) function = myFunction() {}
d) function => myFunction() {}
What is the main purpose of the return statement in a function?
a) To stop the execution of a function
b) To return a value from a function
c) To define a variable
d) To call another function
What is the output of typeof null in JavaScript?
a) "null"
b) "object"
c) "undefined"
d) "boolean"
Which CSS pseudo-class is used to style an element when it is hovered?
a) :hover
b) :active
c) :focus
d) :visited
What is the output of console.log(1 + "2" + "2") in JavaScript?
a) 122
b) 32
c) 14
d) 5
Which HTML5 element is used to define a section of navigation links?
a) <nav>
b) <section>
c) <header>
d) <div>
Which CSS property is used to create rounded corners?
a) border-radius
b) border-style
c) border-width
d) border-color
Which HTML tag is used to define an unordered list?
A) <ol>
B) <li>
C) <ul>
D) <list>
Which attribute is used to specify an image source in HTML?
A) href
B) src
C) alt
D) source
Which tag is used for line breaks in HTML?
A) <br>
B) <break>
C) <lb>
D) <hr>
What is the default file extension for HTML files?
A) .htl
B) .html
C) .web
D) .htx
Which tag is used for tables in HTML?
A) <grid>
B) <table>
C) <tab>
D) <td>
What does the <title> tag define?
A) The webpage name
B) The heading text
C) The URL
D) The navigation bar
Which is NOT a valid CSS unit?
A) em
B) vw
C) sec
D) rem
Which CSS property changes text color? (10 sec)
A) color
B) text-color
C) font-color
D) text-style
Which keyword declares a block-scoped variable?
A) var
B) let
C) const
D) define
How do you define a constant in JavaScript?
A) const variable = value;
B) constant variable = value;
C) var variable = value;
D) let variable = value;
How do you access the first element of an array arr in JavaScript? (10 sec)
A) arr[1]
B) arr[0]
C) arr.first()
D) arr[0]()
Which JavaScript statement is used to terminate a loop or switch? (10 sec)
A) stop
B) exit
C) break
D) continue
Which method checks if a string contains a substring? (10 sec)
A) includes()
B) indexOf()
C) match()
D) contains()
What will the expression false && true evaluate to? (10 sec)
A) false
B) true
C) undefined
D) error
What is the result of true || false? (10 sec)
A) false
B) true
C) undefined
D) null
