Javascript 如何从标记中应用文本框中的select2库
使用select 2 library,在文本框中为标记外接程序将哪些html代码添加到我的页面中 请任何人帮助使用这个Javascript 如何从标记中应用文本框中的select2库,javascript,php,Javascript,Php,使用select 2 library,在文本框中为标记外接程序将哪些html代码添加到我的页面中 请任何人帮助使用这个 <div class="form-group"> <label for="tags"><?php echo __('Tags') ?></label> <textarea rows="2" class="form-control js-example-tags"
<div class="form-group">
<label for="tags"><?php echo __('Tags') ?></label>
<textarea rows="2" class="form-control js-example-tags" id="list_tags" name="list_tags"><?php echo($tags); ?></textarea>
<p class="help-block"><?php echo __('Use commas between tags') ?></p>
</div>
<script type="text/javascript">
$('.js-example-tags').select2({
tags: ["red", "green", "blue"]
})
</script>
i want to create like https://select2.github.io/examples.html#tags this way but don't know how to do this
$('.js示例标记')。选择2({
标签:[“红色”、“绿色”、“蓝色”]
})
我想创造一个https://select2.github.io/examples.html#tags 但我不知道怎么做
我可以试着把html代码,但不要;无法获得任何完美的输出是否替换了要选择的文本区域?我认为select2申请select标签告诉我们您尝试了什么,编码您面临的任何错误等。这应该是评论而不是回答。这个回答对我应该没有帮助