[英]how to make tag supporting in input text of bootstrap material design?
i have created a fiddle here.but its showing error while give the input tags. 我在这里创建了一个小提琴,但是在给输入标签时显示错误。 i want the label to jumb upwards while clicking the input text and can add the tags in input text 我希望标签在单击输入文本时向上翘起,并可以在输入文本中添加标签
html HTML
<form>
<div class="md-form form-width">
<input type="text" id="form41" class="form-control tags">
<label for="form41" class="">Keywords/Tags (Type 5 to 20 items) </label>
</div>
</form>
js JS
<script>
// Material Select Initialization
$(document).ready(function() {
$('.mdb-select').material_select();
$('.tags').tagsinput({
allowDuplicates: true
});
$('.tags').on('itemAdded', function(item, tag) {
$('.items').html('');
var tags = $('.tags').tagsinput('items');
$.each(tags, function(index, tag) {
$('.items').append('<span>' + tag + '</span>');
});
});
});
From the console error message I would say you need to import also jQuery: 从控制台错误消息中,我会说您还需要导入jQuery:
(index):69 Uncaught ReferenceError: $ is not defined bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery (索引):69未捕获的ReferenceError:未定义$ bootstrap.min.js:6未捕获的错误:Bootstrap的JavaScript需要jQuery
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.