contents().find() not producing the same result as changing selector context? - jQuery
- by Alex
Hello all,
I have a function that looks somewhat like this:
function(domObj) {
var currentObj = $(domObj);
...
currentObj.contents().find(".ws").after("foobar");
}
My problem is that the above method of using .contents().find() is not working. "foobar" never gets stuffed after the specified dom element, represented by the selector, .ws
However if I do this:
$(".ws", currentObj).after("foobar");
Then the string, "foobar" gets appended every time.
My question:
Are not these two methods supposed to be equivilant? How/what am I doing wrong in my use of .contents().find() so that it is not working?
Thanks!