I am trying to run some code in javascript in an apache cordova app when an option from a multple select box is selected. The code works perfectly in a normal browser, but not in an apache cordova app. Why?
HTML:
<select multiple="multiple" class="multiple_select_class" onclick="multi_select_onclick();">
<option value='1'>subject1</option>
<option value='2'>subject2</option>
<option value='3'>subject3</option>
<option value='3'>subject3</option>
</select>
JS:
function multi_select_onclick()
{
console.log('number of options: ' + $('.multiple_select_class option').length );
$(".multiple_select_class option").off().on( "click", function(e)
{
console.log('option klicked');
//more code here
});
}
In an apache cordova App, 'option klicked' never shows in the console, but in a regular browser, it does.