HTML QUIZ FOR BEGINNERS
Q #1) What does HTML stand for?
Answer: HTML stands for Hypertext Markup Language.
Q #2) Describe HTML.
Answer: Hypertext Markup Language or HTML is a markup language that is used to
create website templates or WebPages to present the content on the World Wide Web.
HTML pages are saved by adding .html or .html in web page name.
Q #3) Write the basic structure of the HTML template?
Answer: The basic structure of the HTML template is:
<html>
<head>
<title></title>
</head>
<body>
</body></html>
Q #4) What is HTML5?
Answer: HTML5 is the latest or updated version of the markup language that defines
HTML.
Q #5) Name some new features which were not present in HTML but are added to
HTML5?
Answer: Some new features in HTML5 include:
DOCTYPE declaration: <!DOCTYPE html>
section: Section tag defines a section in the document, such as a header, footer
or in other sections of the document. It is used to define the structure of the
document. <section></section>
header: Header tag defines the head section of the document. A header section
always sticks at the top of the document. <header></header>
footer: Footer tag defines the footer section of the document. A footer section
always sticks at the bottom of the document. <footer></footer>
article: Article tag defines an independent piece of the content of a
document. <article> </article>
main: The main tag defines the main section in the document which contains the
main content of the document. <main></main>
figcaption: Figcaption tag defines the caption for the media elements such as an
image or video. <figcaption></figcaption>
Q #6) What is Anchor tag and how can you open an URL into a new tab when
clicked?
Answer: Anchor tag in HTML is used to link between two sections or two different web
pages or website templates.
To open an URL into a new tab in the browser upon a click, we need to add target
attribute equal to _blank.
<a href=”#” target=”_blank”></a>
Q #7) Write an HTML code to form a table to show the below values in a tabular
form with heading as Roll No., Student name, Subject Name, and values as
1. Ram, Physics
2. Shyam, Math
, 3. Murli, Chemistry
Answer: To represent the above values in an HTML table format, the code will be:
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table >
<tr>
<th> Roll No. </th>
<th> Student Name </th>
<th> Subject Name </th>
</tr>
<tr>
<td> 1 </td>
<td>Ram</td>
<td> Physics </td>
</tr>
<tr>
<td> 2 </td>
<td> Shyam </td>
<td> Math </td>
</tr>
<tr>
<td> 3 </td>
<td> Murli </td>
<td> Chemistry </td>
</tr>
</table>
</body>
</html>
Q #8) Define Semantic elements in HTML.
Answer: Semantic elements are HTML elements that represent its meaning to the
browser and developer about its contents.
For Example – p tag represents a paragraph, a tag represents anchor tag, form tag,
table tag, article tag and many more are semantic elements in HTML. Whereas, div tag,
span tag, bold tag are not semantic elements.
Q #9) Define attributes in HTML tag.
Answer: The HTML tag contains a field inside their tag which is called attributes of that
tag.
For Example:
<img src=”#”> here in this tag src is img tag attributes.
<input type=” text”> here in this tag type is input tag attributes.
Q #10) Can we modify the attribute’s value of the HTML tag dynamically?
Answer: Yes, we can modify the value of the attributes by using JavaScript.
Below is the input element whose attribute will be modified from text to password, JS
code to modify the attribute value:
<input type=“text” id=“inputField”>
document.getElementById(“inputField”).attr(“type”, “password”);
Q #11) How can we comment in HTML?
Q #1) What does HTML stand for?
Answer: HTML stands for Hypertext Markup Language.
Q #2) Describe HTML.
Answer: Hypertext Markup Language or HTML is a markup language that is used to
create website templates or WebPages to present the content on the World Wide Web.
HTML pages are saved by adding .html or .html in web page name.
Q #3) Write the basic structure of the HTML template?
Answer: The basic structure of the HTML template is:
<html>
<head>
<title></title>
</head>
<body>
</body></html>
Q #4) What is HTML5?
Answer: HTML5 is the latest or updated version of the markup language that defines
HTML.
Q #5) Name some new features which were not present in HTML but are added to
HTML5?
Answer: Some new features in HTML5 include:
DOCTYPE declaration: <!DOCTYPE html>
section: Section tag defines a section in the document, such as a header, footer
or in other sections of the document. It is used to define the structure of the
document. <section></section>
header: Header tag defines the head section of the document. A header section
always sticks at the top of the document. <header></header>
footer: Footer tag defines the footer section of the document. A footer section
always sticks at the bottom of the document. <footer></footer>
article: Article tag defines an independent piece of the content of a
document. <article> </article>
main: The main tag defines the main section in the document which contains the
main content of the document. <main></main>
figcaption: Figcaption tag defines the caption for the media elements such as an
image or video. <figcaption></figcaption>
Q #6) What is Anchor tag and how can you open an URL into a new tab when
clicked?
Answer: Anchor tag in HTML is used to link between two sections or two different web
pages or website templates.
To open an URL into a new tab in the browser upon a click, we need to add target
attribute equal to _blank.
<a href=”#” target=”_blank”></a>
Q #7) Write an HTML code to form a table to show the below values in a tabular
form with heading as Roll No., Student name, Subject Name, and values as
1. Ram, Physics
2. Shyam, Math
, 3. Murli, Chemistry
Answer: To represent the above values in an HTML table format, the code will be:
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table >
<tr>
<th> Roll No. </th>
<th> Student Name </th>
<th> Subject Name </th>
</tr>
<tr>
<td> 1 </td>
<td>Ram</td>
<td> Physics </td>
</tr>
<tr>
<td> 2 </td>
<td> Shyam </td>
<td> Math </td>
</tr>
<tr>
<td> 3 </td>
<td> Murli </td>
<td> Chemistry </td>
</tr>
</table>
</body>
</html>
Q #8) Define Semantic elements in HTML.
Answer: Semantic elements are HTML elements that represent its meaning to the
browser and developer about its contents.
For Example – p tag represents a paragraph, a tag represents anchor tag, form tag,
table tag, article tag and many more are semantic elements in HTML. Whereas, div tag,
span tag, bold tag are not semantic elements.
Q #9) Define attributes in HTML tag.
Answer: The HTML tag contains a field inside their tag which is called attributes of that
tag.
For Example:
<img src=”#”> here in this tag src is img tag attributes.
<input type=” text”> here in this tag type is input tag attributes.
Q #10) Can we modify the attribute’s value of the HTML tag dynamically?
Answer: Yes, we can modify the value of the attributes by using JavaScript.
Below is the input element whose attribute will be modified from text to password, JS
code to modify the attribute value:
<input type=“text” id=“inputField”>
document.getElementById(“inputField”).attr(“type”, “password”);
Q #11) How can we comment in HTML?