简体   繁体   English

图标:单击触发操作进行搜索

[英]icon: Upon click trigger action to search

I need to make the icon click-able so it searches as another option to hitting the "return key". 我需要使图标可点击,以便搜索另一个选项来点击“返回键”。 Here is a bootply... http://bootply.com/80297 basically, click on the magnifying glass and it performs the search. 这是一个bootply ... http://bootply.com/80297基本上,点击放大镜,它执行搜索。

                <form class="custom-search-form navbar-search" action="/search" method="GET" >
                    <input name="keyword" class="autocomplete span4" placeholder="Search for an Attraction...">
                    <i class="icon-search"></i>
                </form> 

You can also submit the form when you click the image 您也可以在单击图像时提交表单

$("i.icon-search").click(function(){
    $(".custom-search-form").submit();
});

Try this... 尝试这个...

<button type="submit" class="bla" onclick="return whateverYouWant();">
       <i class="icon-search"></i>
</button>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM