Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何从标记中应用文本框中的select2库_Javascript_Php - Fatal编程技术网

Javascript 如何从标记中应用文本框中的select2库

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"

使用select 2 library,在文本框中为标记外接程序将哪些html代码添加到我的页面中 请任何人帮助使用这个

      <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标签

告诉我们您尝试了什么,编码您面临的任何错误等。这应该是评论而不是回答。这个回答对我应该没有帮助