jquery标记编辑器插件Tag Editor使用
作者:互联网
前台代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>tag</title> <link rel="stylesheet" href="lib/layui-v2.6.3/css/layui.css" media="all"> <link rel="stylesheet" href="css/public.css" media="all"> <link rel="stylesheet" href="lib/jQuery-tagEditor-master/jquery.tag-editor.css"> </head> <body> <div id="mytag"></div> <script src="lib/jquery-3.4.1/jquery-3.4.1.min.js"></script> <script src="lib/jQuery-tagEditor-master/jquery.caret.min.js"></script> <script src="lib/jQuery-tagEditor-master/jquery.tag-editor.js"></script> <script> $('#mytag').tagEditor({ delimiter: ',', placeholder: 'Enter tags ...' }); console.log($('#mytag').tagEditor('getTags')[0].tags.toString());//获取值
</script> </body> </html>
先引入jQuery的包,然后引入相关的Tag Editor的css和js
标签:jquery,插件,mytag,tags,tagEditor,Tag,Editor,引入 来源: https://www.cnblogs.com/zhukaile/p/16128519.html