HTML <ins> Tag
The <ins> tag represents text that has been inserted into a document. It's a semantic tag used to mark additions or changes, often paired with <del> (deleted text) to show document edits.
Semantic Meaning
The <ins> tag is semantic HTML that conveys meaning about document changes, not just visual styling. It helps screen readers and other assistive technologies understand that text has been added to a document.
Visual Styling
By default, browsers render <ins> content with an underline to indicate inserted text. You can style it with CSS to match your design. The visual styling is secondary to semantic meaning.
Common Use Cases
Common use cases include: tracking document changes, showing edits in collaborative documents, version control displays, and legal document revisions. Pair <ins> with <del> to show both additions and deletions in edited content.
Attributes
The datetime attribute can specify when the insertion was made. This is useful for tracking when changes occurred in document editing scenarios.
Best Practices
Always use <ins> for semantic meaning, not just visual styling. Pair it with <del> when showing both additions and deletions. Use the datetime attribute when tracking when changes were made. Style with CSS if needed, but remember that semantic meaning is primary.
