Reputation: 267
The change events inside the bootstrap button dropdown is not functioning. What could be the reason? How to fix this?
Below is my fiddle. I wanted to fire a checkbox changed event but surprisingly the below code doesn't fire.
http://jsfiddle.net/20hLtzvr/18/
$('#chk0').click(function()
{
alert('hello world');
});
Upvotes: 2
Views: 217
Reputation: 2297
You forgot the "
when you set the id
Replace
$('#citycountylist ul').append('<li><a href="#"><input type="checkbox" class="chk" id=' + 'chk' + index + ' />' + ' ' + json.NewYork[index].name + ' </a></li>');
By
$('#citycountylist ul').append('<li><a href="#"><input type="checkbox" class="chk" id="' + 'chk' + index + '" />' + ' ' + json.NewYork[index].name + ' </a></li>');
Upvotes: 2