I have written JQuery for my website search functionality. Its working fine when I am using separate file. But when I included same JQuery file in wordpress its not working as required. My question is how to include this code in wordpress
Code:
$('#search').keyup(function () {
var filter = $('#search').val();
$('.et_pb_row').each(function() {
$(this).find("h3:not(:contains('" + filter + "'))").parent().hide();
$(this).find("h3:contains('" + filter + "')").parent().show();
});
});
$, if yes, then usejQueryinstead of$to reference jQuery. 2. Wrap the code in jQuery 3. You can use$(this).val()in handler to get the search text 4. No need ofeachhere,$(".et_pb_row h3:not(:contains('" + filter + "'))").parent().hide();and$(".et_pb_row h3:contains('" + filter + "')").parent().show();