Answer the question
In order to leave comments, you need to log in
Select tag states?
Good afternoon.
In the standard Opencart code, the filter is triggered by pressing the "Search" button. Here is her code:
$('.filter-item').on('click', function() {
filter = [];
$('input[name^=\'filter\']:checked').each(function(element) {
filter.push(this.value);
});
location = '{{ action }}&filter=' + filter.join(',');
});
input:checkbox
. In my template, the filter is made through select
. ('input[name^=\'filter\']:checked')
option
select
Answer the question
In order to leave comments, you need to log in
Yes, but there are selectedIndex and selectedOption properties.
There is also an event for all form elements: 'change', fired when there was interaction with the input field, focus was lost and data changed - you can subscribe to it and read the properties of e.target.selectedOption, e.target.selectedIndex...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question