Computer Knowledge
Markup and Web Languages
1,701 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
-
split()
-
document.clear()
-
join()
-
charAt()
D
Correct answer
Explanation
Among the options, charAt() is a standard string method that was supported in MSIE 3.x. It returns the character at a specified index in a string. Options A (split), B (document.clear), and C (join) were not supported in MSIE 3.x - these methods were added in later versions of JavaScript.
-
The duration of the browser session.
-
The duration the current document stays loaded.
-
Twenty-four hours from the time the cookie is set.
-
There is no default setting.
A
Correct answer
Explanation
By default, if the expires or max-age attribute is omitted from a cookie, it behaves as a session cookie. This means the cookie expires and is deleted when the user closes the browser session, making the first option correct.
-
<?php>...</?>
-
<script>...</script>
-
<&>...</&>
-
<?php…?>
D
Correct answer
Explanation
PHP code is parsed inside standard delimiters, which start with `. Other options like XML/HTML style tags (...?>), ASP-like tags (<&>...&>), or JS script tags (...`) are invalid for default PHP execution.
-
"Hello World";
-
echo "Hello World";
-
Document.Write("Hello World");
-
print("Hello World");
B
Correct answer
Explanation
In PHP, the standard way to output text to the browser is using the echo language construct or the print function. While print("Hello World"); is also valid syntax, echo "Hello World"; is the widely accepted correct answer in basic PHP quizzes. Option 593320 lacks an output keyword, and Document.Write is JavaScript.
-
<javascript>
-
<script>
-
<js>
-
<scripting>
B
Correct answer
Explanation
JavaScript code should be placed inside tags in HTML. Option A uses <javascript> which is not a valid HTML tag, options C and D use <js> and <scripting> which are also not valid standard tags for including JavaScript.
-
("Hello World")
-
document.write("Hello World")
-
response.write("Hello World")
-
"Hello World"
B
Correct answer
Explanation
To write text to a webpage in JavaScript, you use document.write() which outputs content to the document. Option A is just a string literal, option C uses response.write() which is server-side, and option D is just a string without writing it to the document.
-
<script type="text/javascript" name="javascript.js">
-
<script type="text/javascript" src="javascript.js">
-
<script type="text/javascript" href="javascript.js">
-
<script type="text/javascript" link="javascript.js">
B
Correct answer
Explanation
The correct HTML tag to include an external JavaScript file is `with thesrcattribute pointing to the script's URL. Attributes likehref,link, orname` are incorrect for linking scripts in HTML.
-
Both the <head> section and the <body> section are correct
-
The <body> section
-
The <head> section
-
The <JavaScript> section
A
Correct answer
Explanation
JavaScript can be inserted in both the section and the section of an HTML document. The section doesn't exist in HTML, and while both head and body work, the question asks for the correct place implying either is acceptable.
-
Inline
-
Embedded
-
Internal
-
External
-
Home Tool Markup Language
-
Hyperlinks and Text Marking Language
-
Hyper Text Markup Language
-
Hyperlinks and Text Markup Language
C
Correct answer
Explanation
HTML stands for Hyper Text Markup Language. 'HyperText' refers to links that connect pages, 'Markup' means tags that define elements, and 'Language' indicates it's a coding language. Options A, B, and D are incorrect expansions - HTML specifically uses 'Markup' not 'Marking' or 'Marking Language'.
-
<h6>
-
<head>
-
<heading>
-
<h1>
D
Correct answer
Explanation
HTML headings range from
(largest, most important) to (smallest, least important). is the correct tag for the largest heading. contains metadata, not content headings, and is not a valid HTML tag.
-
<input type="checkbox" />
-
<check>
-
<input type="check" />
-
<checkbox>
A
Correct answer
Explanation
HTML checkboxes are created using the input element with type="checkbox". Options B and D use non-existent HTML tags and , while option C uses type="check" which is not a valid input type. Option A is the only correct syntax.
-
<img>image.gif</img>
-
<image src="image.gif" />
-
<img src="image.gif" />
-
<img href="image.gif />
C
Correct answer
Explanation
Images in HTML are inserted using the self-closing img tag with the src attribute specifying the image path. Option A incorrectly uses closing tags, option B uses the non-existent tag, and option D uses 'href' instead of 'src'. Only option C uses the correct img tag syntax.
-
<background img="background.gif">
-
<img src background="background.gif" background />
-
<body background="background.gif">
-
<img src="background.gif" background />
C
Correct answer
Explanation
In traditional HTML, background images were set using the background attribute on the body tag. While modern practices use CSS, option C shows the correct HTML attribute syntax. Options A and B use non-existent attributes or tags, and option D places background as a standalone attribute without the body tag.
-
eXtensible Markup Language
-
Example Markup Language
-
X-Markup Language
-
eXtra Modern Link
A
Correct answer
Explanation
XML stands for eXtensible Markup Language, a widely used format for storing and transporting data. Option A is correct - it represents the full form accurately. Options B, C, and D are incorrect expansions that don't match the actual meaning of XML.