【发布时间】:2020-07-05 16:44:05
【问题描述】:
我想在我的输入字段中设置最多 5 个标签,但 maxNumTags:5 在 jquery 中不起作用我应该怎么做才能为 tagsInput 设置最大值?
HTML
<input
type="text"
class="form-control"
id="tags"
name="tags"
value="{{ old('tags') }}"
data-role="tagsinput"
/>
这是脚本
<script src="dashboard-assets/js/tagsinput.js"></script>
<script>
$("#tags").tags({
maxNumTags: 5
});
</script>
【问题讨论】:
-
jqueryscript.net/form/Bootstrap-4-Tag-Input-Plugin-jQuery.html 从这里我使用 tagsInput js 和 css
标签: javascript html bootstrap-4 bootstrap-tags-input