Text Annotation Solution For Websites Using TypeScript and Vanilla JavaScript

Text annotation solution for websites using TypeScript and Vanilla JavaScript annotate text within the document using the regular button element.

It highlights and underlines text inside a button element and displays details in the lower annotation bar when clicked.


  • Show/hide annotation with one click.
  • Dynamically inserted texts.
  • It can be accessed through the keyboard.

How to make use of it:

1. Load the Annotations.js JavaScript library within the doc.

<link rel="stylesheet" href="./css/annotations.css" />
<script src="./js/annotations.js" defer></script>

2. Define your annotation text.

const annotationTexts = {
      text1: "Text Annotation Here.",
      text2: "HTML Content </br>Is Supported As Well",
      // ...

2. Add the annotation-btn to your button component and outline the annotation within the data-text attribute as follows:

<button type="button" 
        Example 1

<button type="button" 
        Example 2

3. Create the HTML for the annotation bar.

<div class="annotation-wrapper" data-opener="none">
  <button type="button" class="annotation-close-btn" aria-label="close annotation"></button>
  <p class="annotation-text" id="annotation-text"></p>

Simple Text Annotation JavaScript Library, Simple Text Annotations Plugin/Github, image annotation javascript library, javascript annotation library

See Demo And Download

Official Website(k-son): Click Here

This superior jQuery/javascript plugin is developed by k-son. For extra Advanced Usages, please go to the official website.

Related Posts


Responsive Multiple Selection Combo Box using Bootstrap 3 | MagicSuggest

MagicSuggest is an easy-to-use jQuery plugin for creating a combo menu that allows you to select multiple items from a dropdown list with typing and auto-complete support….


Material Design Inspired Tab UI In Vanilla JavaScript

Material Design tab vanilla JS implements a material design-inspired tab component with a click ripple effect and an active sliding menu cursor. Must Read: Responsive Accessible Tabs…


Simple Countdown Timer App In jQuery

The countdown is a front-end application that allows starting the countdown with two options: set a target date or write the number of countdown days. A countdown…


Add Animation to Your HTML5 Pages | animate.js

animate.js is a small JavaScript library that provides a convenient way to apply CSS animations powered by Animate.css to DOM elements without writing any CSS. Easily apply…


Responsive Hover Parallax Cards With Vuejs

Vue Responsive Parallax Cards Hover Create response cards with a scroll-triggered parallax effect in your Vue.js application. Must Read: jQuery Sliding Display Your Content Like a Deck…


Responsive Pure CSS Only Accordion & Tabs Component

Responsive pure CSS accordion tabs and tabs will automatically convert to a vertical accordion interface on mobile devices. Must Read: Create Dynamic Accordion Giving JSON Data Using…