Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
99
rated 0 times [  105] [ 6]  / answers: 1 / hits: 10188  / 5 Years ago, mon, december 16, 2019, 12:00:00

I have a problem in tagify library, I need to set data in input type tagify on click some button,
but not set,
this is my code



        $(document).ready(function() {
$('#getInfo').on('click', function () {
$('#kt_tagify_1').val('tag name');
})
});


this is my library
https://github.com/yairEO/tagify/blob/master/README.md


More From » php

 Answers
5

The demo:







<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns=http://www.w3.org/1999/xhtml xml:lang=en>

<head>
<meta http-equiv=Content-Type content=text/html;charset=UTF-8>
<title>Click Add Tag Demo</title>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@yaireo/[email protected]/dist/tagify.css />
<script src=https://cdn.jsdelivr.net/npm/@yaireo/[email protected]/dist/tagify.min.js></script>
<script src=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js></script>
</head>

<body>
<input type=text name='basic' value=tag1, tag2 />
<button id=click>add tags</button>
<script>
var input = document.querySelector('input[name=basic]');

var tagify = new Tagify(input);


$(#click).on(click, function() {
var n = ADD_IT_ + Math.random();
var tags = [];
tags.push(n);
tagify.addTags(tags);
})
</script>
</body>

</html>





You can find a methon on here https://github.com/yairEO/tagify#events





How to use:




[#5320] Friday, December 13, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
travion

Total Points: 137
Total Questions: 96
Total Answers: 103

Location: India
Member since Wed, Aug 4, 2021
3 Years ago
travion questions
Sat, Oct 19, 19, 00:00, 5 Years ago
Fri, Sep 20, 19, 00:00, 5 Years ago
Wed, Nov 14, 18, 00:00, 6 Years ago
Sun, Oct 28, 18, 00:00, 6 Years ago
Sun, Oct 28, 18, 00:00, 6 Years ago
;