2

I have a checkboxlist from which I want to get check event.

the checkboxes are created dynamically.

I am not able to fire the event

what I tried so far is

$(".XAxisrowCheckbox").click(function () {

            //Do stuff

    });

I also tried with this

    $("input.XAxisrowCheckbox").click(function () {

            //Do stuff

    });

but no luck for me. Tag goes like this:

<input type="checkbox" class="XAxisrowCheckbox">

Please suggest something.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ameya Deshpande
  • 3,580
  • 4
  • 30
  • 46

1 Answers1

5

jQuery.on accepts selector as an argument (http://api.jquery.com/on/)

Example:

$(document).on('click', '.XAxisrowCheckbox', function () {
    //do stuff
});
Andrey
  • 4,020
  • 21
  • 35