I am bind
ing a click event in jquery by:
$('#myButton').bind('click', onButtonClicked);
It works great the first time, but then the view gets rerendered and although I am rebinding the event, it doesn't seem to be working.
I am debugging via firebug and how do I know using JQuery that the click
event has been assigned to this button? It doesn't appear to get translated to a onClick
event in the HTML.
EDIT:
I think the issue appears to be because I am doing something like this:
$("#myDiv").html("<input type='button' id='myButton'/>");
$('#myButton').bind('click', onButtonClicked);
Is this valid? The $("#myButton").data("events")
appears to have a click event assigned to it, but it does nothing when I click the button.