Computer Knowledge
Markup and Web Languages
1,492 Questions
Test your understanding of HTML tags, XML structures, and web page creation technologies. The questions cover elements like CSS styling, parsing documents, and defining web attributes. This section is essential for candidates appearing for computer proficiency tests in various competitive exams.
HTML tags and attributesXML document parsingCSS styling levelsWeb page creation basicsBrowser compatibility
Markup and Web Languages Questions
Which HTML element is used to create a hyperlink?
A
Correct answer
Explanation
The <a> element is used to create a hyperlink, which allows users to navigate to another web page or section of the same page.
Which JavaScript method is used to add an event listener to an element?
-
addEventListener()
-
attachEvent()
-
onclick()
-
onmouseover()
A
Correct answer
Explanation
The addEventListener() method is used to add an event listener to an element, allowing you to specify the event type (such as 'click' or 'mouseover') and the function to be executed when the event occurs.
What is the purpose of using a meta description tag in HTML?
-
To provide a brief summary of the web page's content
-
To specify the author of the web page
-
To define the keywords related to the web page
-
To set the title of the web page
A
Correct answer
Explanation
The meta description tag is used to provide a brief summary of the web page's content, which is often displayed in search engine results and can influence click-through rates.
Which JavaScript method is used to remove an element from the DOM?
-
removeChild()
-
remove()
-
delete()
-
detach()
A
Correct answer
Explanation
The removeChild() method is used to remove an element from the DOM, allowing you to dynamically remove elements from the web page.
Which of the following is a web accessibility guideline that recommends providing alternative text for images?
-
WCAG 2.0
-
ARIA
-
WAI-ARIA
-
HTML5
A
Correct answer
Explanation
WCAG 2.0 is a web accessibility guideline that recommends providing alternative text for images. This allows people with visual impairments to understand the content of images.
Which of the following is a web accessibility guideline that recommends providing captions for videos?
-
WCAG 2.0
-
ARIA
-
WAI-ARIA
-
HTML5
A
Correct answer
Explanation
WCAG 2.0 is a web accessibility guideline that recommends providing captions for videos. This allows people with hearing impairments to access the content of videos.
What is the primary markup language used for creating web pages?
A
Correct answer
Explanation
HTML (Hypertext Markup Language) is the primary markup language used for creating web pages. It defines the structure and content of a web page.
Which organization is responsible for developing and maintaining the LegalXML standard?
-
The American Bar Association (ABA).
-
The International Legal Technology Association (ILTA).
-
The World Wide Web Consortium (W3C).
-
None of the above.
Correct answer
Explanation
The LegalXML Consortium is a non-profit organization dedicated to developing and maintaining the LegalXML standard.
Which of the following is NOT a type of cross-site scripting (XSS) attack?
-
Reflected XSS
-
Stored XSS
-
DOM-based XSS
-
CSRF
D
Correct answer
Explanation
CSRF (Cross-Site Request Forgery) is a type of attack that tricks a user into submitting a request to a web application that they are authenticated to, without their knowledge or consent.
Which of the following is NOT a type of security header?
-
Content-Security-Policy (CSP)
-
X-XSS-Protection
-
X-Frame-Options
-
Referrer-Policy
D
Correct answer
Explanation
Referrer-Policy is not a security header. It is a header that controls how much information about the referrer is sent to the server.
What is the primary purpose of HTML in web development?
-
To define the structure and layout of a web page
-
To add style and visual elements to a web page
-
To enable interactivity and dynamic behavior on a web page
-
To handle data storage and retrieval on a web server
A
Correct answer
Explanation
HTML provides the basic structure and organization of a web page, including headings, paragraphs, lists, and links.
Which CSS property is used to specify the background color of an element?
-
background-color
-
color
-
background-image
-
background-position
A
Correct answer
Explanation
The background-color property sets the background color of an element.
What is the purpose of the `` tag in HTML?
-
To include JavaScript code in a web page
-
To define the structure and layout of a web page
-
To add style and visual elements to a web page
-
To handle data storage and retrieval on a web server
A
Correct answer
Explanation
The `` tag allows you to include JavaScript code in your HTML document, enabling dynamic behavior and interactivity on your web page.
Which of the following is not a valid HTML element?
D
Correct answer
Explanation
The `` element is not a valid HTML element. It is used to embed JavaScript code into an HTML document.
What is the purpose of the fetch API in JavaScript?
-
To send HTTP requests
-
To receive HTTP responses
-
To parse JSON data
-
All of the above
D
Correct answer
Explanation
The fetch API in JavaScript can be used to send HTTP requests, receive HTTP responses, and parse JSON data.