Reputation: 369
I have a link that is embedded in a border that acts as a button, however I only want a click to be registered in the outer part of the button, not when the user clicks inside the input (search) box.
<a href='search'>
<div class='button' id='search_head' style='margin-right: 1em;'>
<input class='search' placeholder=" e.g. blue jeans" type='text'/>
<img src='img/mag_glass_nav.png' height='20' weight='20' />
Search
</div>
</a>
Upvotes: 0
Views: 222
Reputation: 479
I didn't get it!, but i think you shouldn't do that! - DON'T WRAP INPUT ELEMENT WITHIN ANCHOR TAG!! Just wrap your input element and search link within a div with relative position to be able to position the search link. JSFiddle example
<div class="search-wrapper">
<input class='search' placeholder="e.g. blue jeans" type='text' />
<a href="search">
<img src="https://cdn3.iconfinder.com/data/icons/wpzoom-developer-icon-set/500/67-24.png"/>
</a>
</div>
Upvotes: 3
Reputation: 8334
Change simply your markup to something like this :
<input class='search' placeholder=" e.g. blue jeans" type='text'/>
<a href='search'>
<div class='button' id='search_head' style='margin-right: 1em;'><img src='img/mag_glass_nav.png' height='20' weight='20'> Search
</div>
</a>
Upvotes: 0