I have an array. I am getting data from Array and using it in jQuery Append to list. But when I am clicking on list item its only showing the last element.
var a
Can you try this ?
var $list = ""+ firstVal +"" + ""+ secondVal +""; $("#myDiv").append($list); $list.on('click', function(){ alert(thirdVal); });
"+ secondVal +"