在表单标签中添加 Bootstrap 个工具提示

Adding Bootstrap tooltips into form label

我想把 tooltips 变成 laravelcollective

<div class="form-group col-sm-4">
  {!! Form::label('exchange_id', 'Exchanges:') !!}
  {!! Form::select('exchange_id', [''=>'Choose Options'] + $exchanges , null, ['class'=>'form-control', 'id'=>'exchange', 'name'=>'exchange_id',  'onchange' => 'all_function()'])!!}
</div>

在上面的 select 框中,{!! Form::label('exchange_id', 'Exchanges:') !!} 我想放置 Bootstrap 工具提示,例如 Exchange ? : 带问号。
我该怎么做?

您可以将属性添加到 label 标签、data-toggle="tooltip"title="Exchanges ?"

<div class="form-group col-sm-4">
 {!! Form::label('exchange_id', 'Exchanges:', ['data-toggle' => 'tooltip', 'title' => 'Exchanges ?']) !!}
 {!! Form::select('exchange_id', ['' => 'Choose Options'] + $exchanges, null, ['class' => 'form-control', 'id' => 'exchange', 'name' => 'exchange_id', 'onchange' => 'all_function()'])!!}
</div>

需要 bootstrap 插件并喜欢它

$(function () {
  $('[data-toggle="tooltip"]').tooltip()
})

工具提示:http://getbootstrap.com/docs/4.1/components/tooltips/

演示:http://jsfiddle.net/xL1vteoj/