I have a function to display my wordpress search form, and to hide it. The problem is that I want all the container to be clickable to display/hide, but when I click the text input of my search form it hide it. Is it possible to not trigger the onclick event when I click on the input ?
Here is my architecture :
<li onclick="search_form(this)">
<img src="#" >
<div>
<form role="search" id="searchform" method="get" action="/">
<div>
<input type="text" name="s" id="s" size="15" required="" placeholder="Search">
</div>
</form>
</div>
</li>
I have something like that https://puu.sh/t3tiN/8655c07973.png (picture of my li)
Thank you
Edit : Someone asked me for the function, didn't want to add it because it's just css :
function search_form() {
if ($(window).width() > 1041) {
var display = $('#mobile_search_form').css('display');
if (display == "none") {
/* many css animate */
} else if (display == "inline-block") {
/* many css animate */
}
}else if ($(window).width() < 1041) {
window.location.href = "#"
$(document).ready(function () {
$('#result_number').css('display',"none");
});
}
}