Why below code call error when i use sizzle:
var $myInput="#myForm input";
$($myInput+":checked").click(function(){
....
});
the $($myInput+":checked") selector return “[object Object] :checked”.
But when I simply use the variable content like $("#myForm input:checked") work as carefully.
Thanks
$myInputseems to be an object in your code, but is a string in your example code.If you want to filter
$myInputand only apply this event handler to:checkedinputs, use something like this:Note that this handler is bound to elements that exist when
$myInputwas created, so this won’t account for elements created later in time.