Html5 ListBox

Bind to the select event by type:jqxListBox. Author: http://jqwidgets.com

by Shrikrishna Gupta

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='jqxListBox'></div>

JavaScript

var source = [
      "Affogato",
      "Americano",
      "Bicerin",
      "Breve",
      "Café Bombón",
      "Affogato",
      "Americano",
      "Bicerin",
      "Breve",
      "Café Bombón",
      "Café au lait"];
  // Create a jqxListBox
  $("#jqxListBox").jqxListBox({
      source: source, 
      checkboxes: true, 
      width: '200', 
      height: '250px', 
      theme: 'summer'
  });
  
     //var item = $("#jqxListBox").jqxListBox('getSelectedItem'); 
      //        alert("Checked Status: " + item.checked); 
  
  $('#jqxListBox').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);
           alert("Checked Status: " + item.checked); 
        
       }
   });