Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

3TH sem GAT 2023

Total questions: 22

Worksheet time: 9mins

Name
Class
Date
1.

What does XHTML stand for?

a)

a) Extensible HyperText Markup Language

b)

b) Extensible HyperLink Markup Language

c)

Extra HyperText Markup Language

d)

Extreme HyperText Markup Language

2.

What is the purpose of a web server?

a)

To browse the web

b)

To display HTML code

c)

To store and serve web pages to clients

d)

To create web pages

3.

Which part of a URL specifies the protocol?

b)

b) http://

c)

c) /index.html

d)

d) ?id=1

4.

What attribute is mandatory in the <a> tag to create a hyperlink?

a)

a) href

b)

b) src

c)

c) link

d)

c) link

5.

What is the primary difference between HTML and XHTML?

a)

a) XHTML is case-insensitive, while HTML is case-sensitive

b)

b) XHTML must follow strict XML syntax rules, while HTML is more lenient

c)

c) HTML is based on XML, while XHTML is not

d)

d) XHTML supports multimedia content, whereas HTML does not

6.

What does the alt attribute in the <img> tag represent in XHTML?

a)

a) The alignment of the image

b)

b) The alternate text displayed when the image fails to load

c)

c) The URL of the image

d)

d) The tooltip for the image

7.

Which of the following CSS rules has the highest specificity?

a)

a) div p

b)

b) .className

c)

c) #idName

d)

d) p:first-child

8.

Which of these is NOT a valid value for the position property in CSS?

a)

a) static

b)

b) relative

c)

c) fixed

d)

d) float

9.

What is the default display property of a <div> element?

a)

a) inline

b)

b) inline-block

c)

c) block

d)

d) none

10.

Which CSS property can be used to control the stacking order of elements?

a)

a) z-index

b)

b) display

c)

c) visibility

d)

d) position

11.

What is the difference between em and rem units in CSS?

a)

a) em is relative to the root element, while rem is relative to its parent element

b)

b) em is an absolute unit, while rem is relative

c)

c) em is relative to its parent element, while rem is relative to the root element

d)

d) Both are absolute units

12.

Which CSS property is used to define the space between the border and the content of an element?

a)

a) margin

b)

b) padding

c)

c) border-spacing

d)

d) line-height

13.

Which of the following is a new HTML5 semantic element?

a)

a) <div>

b)

b) <section>

c)

c) <span>

d)

d) <blink>

14.

Which JavaScript method is used to write directly into the HTML document?

a)

a) console.log()

b)

b) alert()

c)

c) document.write()

d)

d) innerHTML()

15.

What will the following JavaScript code output?

console.log(typeof null);

a)

a) null

b)

b) undefined

c)

c) object

d)

d) string

16.

Which event is triggered when a user presses a key on the keyboard?

a)

a) onkeypress

b)

b) onkeydown

c)

c) onkeyup

d)

d) All of the above

17.

Which of the following is a correct way to access an element with an id of example in the DOM?

a)

a) document.getElementByClassName("example")

b)

b) document.getElementById("example")

c)

c) document.querySelector("#example")

d)

d) Both b and c

18.

How can you prevent the default action of an event in JavaScript?

a)

a) event.preventDefault();

b)

b) event.stopPropagation();

c)

c) event.returnValue = false;

d)

d) Both a and c

19.

What is the primary role of ReactDOM in a React application?

a)

a) To provide lifecycle methods

b)

b) To create the virtual DOM

c)

c) To render React components into the actual DOM

d)

d) To manage component state

20.

Which of the following is TRUE about JSX in React?

a)

a) JSX is mandatory to create React components

b)

b) JSX is a syntax extension that must be compiled into JavaScript

c)

c) JSX requires components to be written as classes only

d)

d) JSX can include multiple root elements without wrapping them

21.

Which of the following is the correct syntax to add inline styles in React?

a)

a) <div >

b)

b) <div style={{backgroundColor: 'red'}}>

c)

c) <div class="background-color-red">

d)

d) <div style={{'background-color': 'red'}}>

22.

How would you dynamically import a component in React?

a)

a) import MyComponent from './MyComponent'

b)

b) const MyComponent = require('./MyComponent')

c)

c) const MyComponent = React.lazy(() => import('./MyComponent'))

d)

d) const MyComponent = React.createElement('./MyComponent')