12 KiB
| title | chunk | source | category | tags | date_saved | instance |
|---|---|---|---|---|---|---|
| Caret - Glossary | MDN | 1/3 | https://developer.mozilla.org/en-US/docs/Glossary/Caret | reference | web, html, css, javascript, documentation | 2026-05-05T05:27:06.997153+00:00 | kb-cron |
MDN HTML HTML: Markup language
HTML reference
HTML guides
Markup languages
CSS reference
CSS guides
Layout cookbook
JavaScriptJS JavaScript: Scripting language
JS reference
JS guides
Web APIs Web APIs: Programming interfaces
Web API reference
Web API guides
- Using the Web animation API
- Using the Fetch API
- Working with the History API
- Using the Web speech API
- Using web workers
Technologies
Topics
Learn Learn web development
Frontend developer course
- Getting started modules
- Core modules
- MDN Curriculum
- Check out the video course from Scrimba, our partner
Learn HTML
Learn CSS
Learn JavaScript
Tools Discover our tools
About Get to know MDN better
Caret
A caret (sometimes called a "text cursor") is an indicator displayed on the screen to indicate where text input will be inserted.
Most user interfaces represent the caret using a thin vertical line or a character-sized box that flashes, but this can vary. This point in the text is called the insertion point. The word "caret" differentiates the text insertion point from the mouse cursor.
On the web, a caret is used to represent the insertion point in <input> and <textarea> elements, as well as any elements whose contenteditable attribute is set, thereby allowing the contents of the element to be edited by the user.
In this article
See also
- Caret navigation on Wikipedia
CSS related to the caret
You can set the color of the caret for a given element's editable content by setting the element's CSS caret-color property to the appropriate <color> value.
HTML elements that may present a caret
These elements provide text entry fields or boxes and therefore make use of the caret.
<input type="text"><input type="password"><input type="search"><input type="date">,<input type="time">, and<input type="datetime-local"><input type="number">,<input type="range"><input type="email">,<input type="tel">, and<input type="url"><textarea>- Any element with its
contenteditableattribute set