<div class='input-group manualInput'>
<input id='address-input' type='text' class='form-control' placeholder='Enter your current location!'/>
<span class='input-group-addon'>
<i class='glyphicon glyphicon-search'></i>
</span>
</div>
如何使glyphicon可点击?并调用JS函数
答案 0 :(得分:5)
像这样添加JavaScript onClick
事件:
<span class='input-group-addon'>
<i class='glyphicon glyphicon-search' onclick="myfunction();"></i>
</span>
答案 1 :(得分:1)
关闭他们的网站:
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button">Go!</button>
</span>
</div><!-- /input-group -->