JQuery ComboBox
Invoke the val method of the jqxComboBox
Author: http://jqwidgets.com
by Hristo Hristov
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="ttp://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='jqxComboBox'></div>
<div>
<input style="margin-top: 20px;" type="button" id='jqxButton' value="Set new value" />
</div>
JavaScript
var source = [
"Affogato",
"Americano",
"Bicerin",
"Breve",
"Café Bombón",
"Café au lait",
"Caffé Corretto",
"Café Crema",
"Caffé Latte"];
// Create a jqxComboBox
$("#jqxComboBox").jqxComboBox({
source: source,
theme: 'energyblue',
width: '200px',
height: '25px',
selectedIndex:2
});
$("#jqxButton").jqxButton({
theme:'energyblue'
});
setTimeout(_ => {
alert($("#jqxComboBox").jqxComboBox("val"));
}, 1001)
$('#jqxButton').on('click', function () {
$("#jqxComboBox").jqxComboBox('val', "Caffé Latte");
});