HTML - Set 4

HTML Question & Answer Practice

HTML Practice – Questions & Answers

Beginner Level – Part 3

Q36. Which tag is used to create a button?

Answer: <button>

Q37. How do you display special characters like < and >?

Answer: Use HTML entities: &lt; and &gt;

Q38. Which tag is used to display an image caption?
<figure>
  <img src="img.jpg">
  <figcaption>Image Caption</figcaption>
</figure>
Q39. What is the use of lang attribute?

Answer: It specifies the language of the webpage for accessibility and SEO.

Q40. Which tag is used to make text smaller?

Answer: <small>

Intermediate Level – Part 3

Q41. What is the difference between GET and POST?

Answer:
GET sends data in the URL.
POST sends data securely in the request body.

Q42. Write HTML code for a dropdown list.
<select>
  <option>HTML</option>
  <option>CSS</option>
</select>
Q43. How do you group form fields?
<fieldset>
  <legend>Personal Info</legend>
</fieldset>
Q44. Which attribute disables an input field?

Answer: disabled

Q45. What is the use of label tag?

Answer: It defines a label for form inputs and improves accessibility.

Advanced Level – Part 3

Q46. What is the use of contenteditable?

Answer: It allows users to edit content directly in the browser.

Q47. What is the purpose of hidden attribute?

Answer: It hides elements from the user view.

Q48. Write HTML code using details and summary.
<details>
  <summary>Click Me</summary>
  Content Here
</details>
Q49. What is the use of main tag?

Answer: It represents the main content of the document.

Q50. Difference between localStorage and sessionStorage?

Answer:
localStorage stores data permanently.
sessionStorage stores data for a session.

No comments:

Post a Comment