Reputation: 621
I can search the dom with .find('.dbfieldname') to find all elements from the class dbname. I also can save the result as an object in a variable like that: myelems = .find(...
But I can't search in my object for certain elements using find()
. I tried the following:
my.find(*[name=versionnumber])
How can I do that right ?
Upvotes: 0
Views: 440
Reputation: 7297
Your logic is fine, my
is already a jQuery object, so my.find()
would normally work.
The problem is that .find()
searches for childrens. What you want is my.filter('[name="' +versionnumber+ '"]');
Upvotes: 4
Reputation: 26941
jQuery(my).find("*[name=versionnumber]")
Btw, better use jQuery.find()
or $.find()
rather than just .find()
, it makes code at least more readable.
Upvotes: 0