使用bootstrap studio无法单击Bootstrap input-group-addon

时间:2017-10-23 13:36:35

标签: jquery bootstrap-4

我关注this site

生成了html:

    <div class="input-group date">
          <input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
    </div>

和.js

    $('#sandbox-container .input-group.date').datepicker({
        format: "yyyy-mm-dd",
        language: "pl"
    });

我有相同的html和.js它看起来像oke但输入组插件不可点击。

1 个答案:

答案 0 :(得分:2)

您可以使用解决方案

$('.input-group.date').datepicker({
  format: "yyyy-mm-dd",
  language: "pl"
});
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/js/bootstrap-datepicker.min.js"></script>
<div class="input-group date">
  <input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>

什么是#sandbox-container

希望这会对你有所帮助。