bananabreadbob
bananabreadbob

Reputation: 407

Bootstrap: Make glyphicon within input clickable

I have the following code that produces this: enter image description here

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

How do I make the glyphicon clickable? And call a JS function

Upvotes: 3

Views: 9998

Answers (2)

ScaisEdge
ScaisEdge

Reputation: 133400

Add a JavaScript onClick event like this:

<span class='input-group-addon'>
    <i class='glyphicon glyphicon-search' onclick="myfunction();"></i>
</span>

Upvotes: 6

stackunderflow
stackunderflow

Reputation: 422

Right off their website:

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

Upvotes: 0

Related Questions