I have the following js code:
$("#mySelector").change(function(){
console.log($(this).length);
});
I know this is wrong code to get the number of items in selector. But how should I get this number in correct way?
P.S.
In normal way I should use $("#mySelector option").length to get this number. But how to add option to $(this) operator?
or for options ?
FIDDLE