w3resource

HTML5: How to specify a URL to a document that explains the reason why the text was inserted/changed?

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html><!-- Declares the document type and version of HTML -->
<html>
<head>
<meta charset="utf-8"><!-- Specifies the character encoding for the document -->
<title>How to specify a URL to a document that explains the reason why the text was inserted/changed</title><!-- Sets the title of the document -->
</head>
<body>
<p>w3resource is a tutorial site. <!-- Starts a paragraph -->
<ins cite="i-answer.html"><!-- Represents inserted text with a citation to explain why it was inserted -->
It is very informative and easy to learn tutorial for the beginners. <!-- The inserted text -->
</ins></p><!-- Ends the paragraph -->
</body>
</html>

Explanation:

  • The HTML document starts with a declaration of its type and version (<!DOCTYPE html>).
  • The <html> element encloses the entire HTML document.
  • The <head> section contains metadata about the document, including the character encoding (<meta charset="utf-8">) and the title of the document (<title>).
  • Inside the <body> section, there's a <p> element, which represents a paragraph of text.
  • Within the paragraph, there's an <ins> element, which indicates inserted text. The cite attribute specifies a URL to a document that explains the reason why the text was inserted or changed. In this case, "i-answer.html" is used as a placeholder URL.
  • The text "It is very informative and easy to learn tutorial for the beginners." is marked as inserted text and displayed in the paragraph.

Live Demo:

See the Pen insert-cite-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
YesYesYesYesYes

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.