That's correct, I just tried it using jQuery 1.5.1 and it returned an empty set []
, I would recommend updating the jQuery, if you have to use it, you can read the name
properties instead:
inputs.filter(function() {
return this.name === "skus[0].skuattributeoptions[1].sao_option_id";
});
Edit: And it also work if you escape the [
, ]
and .
characters instead of using quotes, it seems there is a bug in jQuery 1.5.1's .filter()
method:
inputs.filter('[name=skus\\[0\\]\\.skuattributeoptions\\[1\\]\\.sao_option_id]');
Well, that version is an old one, it had been released in February of 2011 and this problem doesn't exist in newer versions.