限制 Bootstrap 输入标签最多 100 个标签

Restrict Bootstrap Input tags maximum 100 tags

嗨,朋友们,我正在为我的项目使用 bootstrap 标签输入,但我只需要输入 100 个标签,之后应该不允许将标签输入到输入字段中。

HTML :

<input type="text"  class="form-control" id="skill_nameone" name="skill_name"  data-role="tagsinput"  />

JS:

bootstrap-tagsinput.min

CSS :

bootstrap-tagsinput.css

图片:

此输入字段只能容纳 100 个标签。在上图中,它包含 7 个标签。

提前致谢。

您可以像这样使用 maxTags 来限制标签​​的最大数量:

$('input').tagsinput({
  maxTags: 100
});

签入 .js 文件。找到单词 maxTags:undefined。把世界undefined改成你想限制的数量