I tried every solution out there for this problem including.
I'm trying to copy the value from a div to an search input and, then, press enter. The search input it's from list.js and automatically show results when you type but copying the values doesn't have the same effect.
Here's my code:
<input type="search" class="search" placeholder="Pesquisar..." id="pesq" />
<div id="cat">
<div class="test">Premium</div>
<div class="test">Freemium</div>
<div class="test">Free</div>
</div>
<script>
$(document).ready(function(){
$("#cat div").click(function(){
var value = $(this).html();
var input = $('#pesq');
var e = $.Event( "keypress", { which: 13 } );
input.focus().val(value).trigger(e);
});
});
</script>
Help, please!