Html DropDownList

Bind to the change event by type:jqxDropDownButton. Author: http://jqwidgets.com 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="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='jqxDropDownList'></div>

JavaScript

var source = [
  "Affogato",
  "Americano",
  "Bicerin",
  "Breve",
  "Café Bombón",
  "Café au lait",
  "Caffé Corretto",
  "Café Crema",
  "Caffé Latte"];
// Create a jqxDropDownList
$("#jqxDropDownList").jqxDropDownList({
  source: source,
  theme: 'energyblue',
  width: '200px',
  height: '25px',
  selectedIndex: 3
});
$('#jqxDropDownList').on('select', function (event) {
  var args = event.args;
  if (args) {
    // index represents the item's index.                          
    var index = args.index;
    var item = args.item;
    // get item's label and value.
    var label = item.label;
    var value = item.value;
    alert("label: " + label);
  }
});