var function1 = function (ans){
alert("A");
}
$(document).ready({
$("input[type='radio']").click(function1(ans));
});
If function1
has no parameter then we can just have .click(function1)
and function1
will not be called.
Meanwhile, when there is a parameter, function1
is called immediately when document is loaded. How to pass a parameter to a function without having the function called ?