2

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');
    });

1 Answer 1

2

You forgot the " when you set the id

Replace

$('#citycountylist ul').append('<li><a href="#"><input type="checkbox" class="chk" id=' + 'chk' + index + ' />' + '&nbsp;' + json.NewYork[index].name + ' </a></li>');

By

$('#citycountylist ul').append('<li><a href="#"><input type="checkbox" class="chk" id="' + 'chk' + index + '" />' + '&nbsp;' + json.NewYork[index].name + ' </a></li>');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.