JQuery ComboBox

Invoke the getVisibleItems method of the jqxComboBox Author: http://jqwidgets.com

by jqwidgets

HTML

<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<div id='jqxComboBox'></div>
<div>
    <input style="margin-top: 20px;" type="button" id='jqxButton' value="Show the item" />
</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: 0
  });
  $("#jqxButton").jqxButton({
      theme:'energyblue'
  });
var items = $("#jqxComboBox").jqxComboBox('getVisibleItems');
 var item1 = items[0];
 var item2 = items[1];
  $('#jqxButton').on('click', function () {
alert("Item 1: " + item1.label + ", Item 2: " + item2.label);
  });