'How to get multiple values using jq
I want to get multiple statuses from a select when I press a button, there are about 5 options I either want to be able to get option 1 and 2 and 3 or all 5 of them but not empty ones.
What I am already doing will return 1 specific option which is optionA and If i replace this with .val() it will just get the first option in the list
$('#myButton').on('click',function(){
$('.filter__status').val("optionA");
loadList();
});
select option below
<div class="inputRow">
<label>Status:</label>
<select class="filter__status" id="status" name="index[filters][status]">
<?php foreach (Options::statuses() as $status): ?>
<option value="<?= $status ?>" <?= ($_GET['status'] === $status ? "selected" : "") ?>><?= $status ?></option>
<?php endforeach; ?>
</select>
</div>
<div id="myButton" class="button large"><i></i> <span>Show lists</span></div>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
