1

I'm having a little trouble with the .find() jquery function. When I select a variable with jquery and try to run the find method off of it like this,

$rooParent = $(".rooParent"); // .rooParent element
$roo = $($rooParent).find(".roo"); // undefined

It works and the variable $roo is the correct element.

But when I do the same in a js object,

$rooParent: $(".rooParent"), // .rooParent element
$roo: $(this.$rooParent).find(".roo") // undefined

The second variable (using the .find method ) returns undefined.

I've used console.log() to find the results commented after each line.

My question is is there anything I'm missing which I'm not aware of happening in my code?

NOTE:

I would prefer to use the find method off of a variable as it should be slightly quicker and there are many more instances in my website where I could use this Info.

Procode238
  • 43
  • 7

0 Answers0