I need to make a search by using jquery, I have an :
input text with this id idTextSearch:
<input id="idTextSearch" name="name" type="text" style="width:70%;" >
input button with this id idButtonSearch:
<input id="idButtonSearch" type="button" value="Search" onclick="searching()" class="alt_btn">
and a <ul class="toggle" id="idUl"> with different <li value="thisIsAValue">
Now, I need to create my searching(), this function will hide all elements field different to $("#idTextSearch").val() and show only one field with the same value of this input text.
Next time, please post what you’ve tried to do to solve the problem. In this case I’ll give you the answer because it’s simple, but we’re here to help you, not to write all your code for you.
Note that the
valueattribute technically doesn’t exist on thelielement, you should prefix it withdata. Eg:And the javascript/jQuery: