i have been struggling with this for the past 6 hours but i can't find a solution. I'm using jquery mobile 1.4.5. I have a select with 5 options. They are all selected and when one is deselected i want to do something. So i'd like to get the id of the deselected option. This is my html:
<ul data-role="listview" data-inset="false" data-icon="false" data-divider-theme="b">
<li data-role="list-divider"><h2>Upcoming events <button data-role="none" class="filter" type="submit">
<i class="fa fa-filter"></i>
</button><button onclick="hide()">Hide social</button><button onclick="show()">show social</button><h2></li>
<div class="ui-field-contain sixtynine" data-position-to="window">
<select name="select-custom-19" id="filter-type" multiple="multiple" data-native-menu="false">
<option>Filter events</option>
<option value="1" selected="selected" id="f-1">family</option>
<option value="2" selected="selected" id="f-2">friends</option>
<option value="3" selected="selected" id="f-3">business</option>
<option value="4" selected="selected" id="f-4">social</option>
<option value="5" selected="selected" id="f-5">private</option>
</select>
</div>
<li data-role="list-divider"><h2>Today<h2></li>
// irrelevant
The "hide social" and "show social" work. And i want to be able to have their behavior inside the select. So instead of 2 buttons (1 showing, 1 hiding) I have a select option when checked shows the element and when unchecked hides it. Idem for the other 4 options.
So how can i solve this?