【问题标题】:How to add class "form-control" to generated bootstrap-tags-input?如何将类“表单控制”添加到生成的引导标签输入?
【发布时间】:2021-11-25 22:42:21
【问题描述】:

我在 ajax 调用后显示的模式中使用引导标记输入。

现在我想将类“form-control”添加到生成的输入标签中。

我试过这样:

$(".bootstrap-tagsinput > 输入").addClass('form-control');

但它对我不起作用。

这是生成的输入:

<div class="bootstrap-tagsinput">
   <input type="text" placeholder="">
</div>

有什么想法吗?

【问题讨论】:

    标签: jquery bootstrap-tags-input


    【解决方案1】:

    您不需要&gt; 符号

    $(".bootstrap-tagsinput input").addClass('form-control');
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <div class="bootstrap-tagsinput">
      <input type="text" placeholder="">
    </div>

    参考:

    【讨论】:

    • 我试过这样 $("#share_collection_container").html(result.share_collection_modal) $(".bootstrap-tagsinput input").addClass('form-control'); $("#share_collection").modal("show");但仍然无法正常工作
    • 我需要所有的html,我回答你的问题这是其他细节
    猜你喜欢
    • 2018-10-12
    • 2018-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多