Very simple way to input tags with Tagify.
<div class="mb-6"> <label for="exampletags" class="inline-block mb-2">Tags</label> <input type="text" name="tags" value="Tags1, Tags2" class="tagify w-full leading-5 relative text-sm py-2 uajskeiolksb rounded text-gray-800 bg-white border border-gray-300 overflow-x-auto focus:outline-none focus:border-gray-400 focus:ring-0 dark:text-gray-300 dark:bg-gray-700 dark:border-gray-700 dark:focus:border-gray-600" id="exampletags" minlength="2"> </div> <!-- tagify --> <script src="../vendors/@yaireo/tagify/dist/tagify.js"></script> <script> // Input tags const myTagify = function () { // tagify const input_tags = document.querySelectorAll("input.tagify"); if ( input_tags != null) { for( let i = 0; i < input_tags.length; i++) { new Tagify(input_tags[i]); } } } myTagify(); </script>
More information about tagify please read on here