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
What is the syntax for using the *ngIf directive in Angular?
-
<div *ngIf="condition">My Element
-
<div [ngIf]="condition">My Element
-
<div ngIf="condition">My Element
-
None of the above
A
Correct answer
Explanation
To use the *ngIf directive in Angular, you specify the condition that you want to evaluate in the *ngIf attribute. If the condition is true, the element will be displayed. If the condition is false, the element will be hidden.
Which CSS property is used to define the direction of an animation?
-
animation-direction
-
transition-direction
-
animation-timing-function
-
transition-timing-function
A
Correct answer
Explanation
The animation-direction property specifies whether an animation should play forwards, backwards, or in alternate directions.
Which CSS property is used to specify the fill mode of an animation?
-
animation-fill-mode
-
transition-fill-mode
-
animation-timing-function
-
transition-timing-function
A
Correct answer
Explanation
The animation-fill-mode property specifies how the animated element should appear before the animation starts and after it ends.
What is the purpose of the XMLHttpRequest object?
-
To send and receive HTTP requests
-
To parse JSON data
-
To create HTML elements
-
To handle events
A
Correct answer
Explanation
The XMLHttpRequest object is used to send and receive HTTP requests in JavaScript.
What are the different states of an XMLHttpRequest object?
-
UNSENT, OPENED, HEADERS_RECEIVED, LOADING, DONE
-
NEW, CONNECTED, SENDING, RECEIVING, CLOSED
-
REQUEST, RESPONSE, ERROR, ABORTED
-
PENDING, ACTIVE, COMPLETED
A
Correct answer
Explanation
The XMLHttpRequest object goes through different states during its lifetime: UNSENT, OPENED, HEADERS_RECEIVED, LOADING, DONE.
How can you handle the response of an XMLHttpRequest request?
-
Using the onload event
-
Using the onreadystatechange event
-
Using the onprogress event
-
All of the above
D
Correct answer
Explanation
You can handle the response of an XMLHttpRequest request using the onload, onreadystatechange, and onprogress events.
What is the purpose of the status property in XMLHttpRequest?
-
To indicate the status code of the response
-
To indicate the state of the request
-
To indicate the size of the response
-
To indicate the type of the response
A
Correct answer
Explanation
The status property in XMLHttpRequest indicates the status code of the response.
What does HTML stand for?
-
Hypertext Markup Language
-
Hypertext Modeling Language
-
Hypertext Machine Language
-
Hypertext Markup Link
A
Correct answer
Explanation
HTML stands for Hypertext Markup Language, a markup language used to create the structure and content of web pages.
Which HTML element is used to define the main content of a web page?
-
<head>
-
<body>
-
<title>
-
<html>
B
Correct answer
Explanation
The <body> element in HTML defines the main content of a web page, where the actual content is placed.
What is the correct syntax for creating a heading in HTML?
-
<h1>Heading</h1>
-
<heading>Heading</heading>
-
<h>Heading</h>
-
<head>Heading</head>
A
Correct answer
Explanation
In HTML, headings are created using the <h1> to <h6> elements, with <h1> being the most prominent heading.
Which HTML attribute is used to specify the link destination of an anchor (<a>) element?
A
Correct answer
Explanation
The 'href' attribute in the <a> element specifies the link destination, allowing users to navigate to another web page or section of the current page.
What is the purpose of the <meta> tag in HTML?
-
To define the title of the web page
-
To provide metadata about the web page
-
To create a link to another web page
-
To insert an image into the web page
B
Correct answer
Explanation
The <meta> tag in HTML is used to provide metadata about the web page, such as its title, description, keywords, and other information relevant to search engines and web crawlers.
Which HTML element is used to create a bulleted list?
A
Correct answer
Explanation
The <ul> element in HTML is used to create an unordered (bulleted) list, where each item is represented by a list item (<li>).
What is the correct syntax for creating a table in HTML?
-
<table><thead><tr><th>Heading</th></tr></thead><tbody><tr><td>Data</td></tr></tbody></table>
-
<table><tr><th>Heading</th></tr><tr><td>Data</td></tr></table>
-
<table><thead><tr><td>Heading</td></tr></thead><tbody><tr><th>Data</th></tr></tbody></table>
-
<table><tr><td>Heading</td></tr><tr><td>Data</td></tr></table>
A
Correct answer
Explanation
In HTML, a table is created using the <table> element, with <thead> for the table header, <tbody> for the table body, <tr> for table rows, and <th> and <td> for table headings and data cells respectively.
Which HTML element is used to create a form?
-
<form>
-
<input>
-
<button>
-
<label>
A
Correct answer
Explanation
The <form> element in HTML is used to create a form that allows users to input data, such as text, numbers, or selections, and submit it to a server for processing.