Minimal Clean Tagging System In Vanilla JavaScript – Simple Tags

Category: Form , Javascript | December 18, 2019
Author: kurtobando
Views Total: 978 views
Official Page: Go to website
Last Update: December 18, 2019
License: MIT

Preview:

Minimal Clean Tagging System In Vanilla JavaScript – Simple Tags

Description:

A simple, lightweight tagging system that allows the user to insert multiple tags/tokens into a pretty clean tags input.

Type something in the tags input and press the Enter or Semicolon key to create a new tag.

How to use it:

1. Create a placeholder for the tags input.

<div id="myTags" class="simple-tags"></div>

2. Insert the Simple Tags plugin’s files into the HTML document.

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

3. Initialize the tags input and done.

const tags = new Tags('#myTags')

4. You can also define an array of pre-selected tags in the JavaScript as follows:

const tags = new Tags('#myTags', ["CSS", "Script", "Com"])

You Might Be Interested In:


Leave a Reply