I would like to hide a div when the input length is less than 3 characters long.
Here is my code:
<div id="Container" class="content">
<input type="text" name="search" class="search" id="searchid" placeholder="Wyszukaj..." /><br />
<div id="result"></div>
</div>
<script>
$('input[name=search]').change(function()
{
if( $(this).val().length < 3 ) {
jQuery("#result").fadeOut();
}
});
</script>
IMPORTANT: That should work when user is changing this input.
Thanks.