Is it possible to combine two different element types, handling the same function?
Hello,
I have an element type Input and an Select like:
- <input type= "text" class="filter_field" id=filter_anam" name="filter_anam" value="filter op achternaam">
- <select class="filter_field form-control" id=filter_catg" name="filter_catg">
I have created for each a jQuery function which is working:
- jQuery('.filter_field').keyup(function(){
filter_data();
});
And
- jQuery('select[name=filter_catg]').change(function() {
filter_data()
console.log('Waarde select: ' + jQuery(this).val());
});
Is it possible to combine these two different element types functions to one function?
Thanks in advance,