JQuery ListBox

Invoke the addItem method of the jqxListBox. Author: http://jqwidgets.com

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='jqxWidget'>
        </div>
<div>
    <input style="margin-top: 20px;" type="button" id='jqxButton' value="Add item" />
</div>

JavaScript

var source = [
                // Business & Investing
                    {html: "<div><div>Title: Do the Work</div><div>Author: Steven Pressfield</div></div>", title: "Do the Work", group: "Business & Investing" },
                    { html: "<div><div>Title: Think and Grow Rich</div><div>Author: Napoleon Hill</div></div>", title: "Think and Grow Rich", group: "Business & Investing" },
                // Computer & Internet Books
                    {html: "<div><div>Title: MacBook Pro Portable Genius</div><div>Author: Brad Miser</div></div>", title: "MacBook Pro Portable Genius", group: "Computer & Internet Books" },
                // History
                    {html: "<div><div>Lincoln and His Admirals</div><div>Author:Craig L. Symonds</div></div>", title: "Lincoln and His Admirals", group: "History" },
                    { html: "<div><div>The Dogs of War: 1861</div><div>Author:Emory M. Thomas</div></div>", title: "The Dogs of War: 1861", group: "History" },
                 ];
                // Create a jqxListBox
                $("#jqxWidget").jqxListBox({ source: source, width: 300, height: 350});
  $("#jqxButton").jqxButton({
      theme:'energyblue'
  });
  $('#jqxButton').on('click', function () {
 			var newItem =  {html: "<div><div>Title: New</div><div>Author: New </div></div>", title: "New", group: "Business & Investing" };
      source.push(newItem);              
			$("#jqxWidget").jqxListBox('refresh');
  });