Worksheets3TH sem GAT 2023
Total questions: 22
Worksheet time: 9mins
What does XHTML stand for?
a) Extensible HyperText Markup Language
b) Extensible HyperLink Markup Language
Extra HyperText Markup Language
Extreme HyperText Markup Language
What is the purpose of a web server?
To browse the web
To display HTML code
To store and serve web pages to clients
To create web pages
Which part of a URL specifies the protocol?
What attribute is mandatory in the <a> tag to create a hyperlink?
a) href
b) src
c) link
c) link
What is the primary difference between HTML and XHTML?
a) XHTML is case-insensitive, while HTML is case-sensitive
b) XHTML must follow strict XML syntax rules, while HTML is more lenient
c) HTML is based on XML, while XHTML is not
d) XHTML supports multimedia content, whereas HTML does not
What does the alt attribute in the <img> tag represent in XHTML?
a) The alignment of the image
b) The alternate text displayed when the image fails to load
c) The URL of the image
d) The tooltip for the image
Which of the following CSS rules has the highest specificity?
a) div p
b) .className
c) #idName
d) p:first-child
Which of these is NOT a valid value for the position property in CSS?
a) static
b) relative
c) fixed
d) float
What is the default display property of a <div> element?
a) inline
b) inline-block
c) block
d) none
Which CSS property can be used to control the stacking order of elements?
a) z-index
b) display
c) visibility
d) position
What is the difference between em and rem units in CSS?
a) em is relative to the root element, while rem is relative to its parent element
b) em is an absolute unit, while rem is relative
c) em is relative to its parent element, while rem is relative to the root element
d) Both are absolute units
Which CSS property is used to define the space between the border and the content of an element?
a) margin
b) padding
c) border-spacing
d) line-height
Which of the following is a new HTML5 semantic element?
a) <div>
b) <section>
c) <span>
d) <blink>
Which JavaScript method is used to write directly into the HTML document?
a) console.log()
b) alert()
c) document.write()
d) innerHTML()
What will the following JavaScript code output?
console.log(typeof null);
a) null
b) undefined
c) object
d) string
Which event is triggered when a user presses a key on the keyboard?
a) onkeypress
b) onkeydown
c) onkeyup
d) All of the above
Which of the following is a correct way to access an element with an id of example in the DOM?
a) document.getElementByClassName("example")
b) document.getElementById("example")
c) document.querySelector("#example")
d) Both b and c
How can you prevent the default action of an event in JavaScript?
a) event.preventDefault();
b) event.stopPropagation();
c) event.returnValue = false;
d) Both a and c
What is the primary role of ReactDOM in a React application?
a) To provide lifecycle methods
b) To create the virtual DOM
c) To render React components into the actual DOM
d) To manage component state
Which of the following is TRUE about JSX in React?
a) JSX is mandatory to create React components
b) JSX is a syntax extension that must be compiled into JavaScript
c) JSX requires components to be written as classes only
d) JSX can include multiple root elements without wrapping them
Which of the following is the correct syntax to add inline styles in React?
a) <div >
b) <div style={{backgroundColor: 'red'}}>
c) <div class="background-color-red">
d) <div style={{'background-color': 'red'}}>
How would you dynamically import a component in React?
a) import MyComponent from './MyComponent'
b) const MyComponent = require('./MyComponent')
c) const MyComponent = React.lazy(() => import('./MyComponent'))
d) const MyComponent = React.createElement('./MyComponent')
