I have set a click handler on button1, when the click handler is called it prints the id of the button and the value of "onclick" based on e.currentTarget. The callback is called corrrectly, the id is correct, BUT the "onclick" value has a value of "undefined" not something that represents the function that is called in practice (actually the value is "null" when I check in the chrome debugger). My question is 1) Why is e.currentTarget.onclick null ? 2) Where can I see if an onclick function is defined and wht it's value is ? Thanks
<body>
<div id="top1"><button id="but1"> button 1</button></div>
</body>
function call_cb_click(text) {
return function foo(e) {
console.log("in callback for "+ text + "cb is " + e.currentTarget.onClick);
}
}
function test() {
$("#but1").on('click',call_cb_click("button 1 "));
}
$(document).ready(test);