The following code is inspired by http://ignorethecode.net/blog/2010/04/20/footnotes/: when you move the cursor over the footnote symbol, the footnote is shown as a tool-tip.
Solution 1:
var sup = $fRef.children("sup")[i];
takes the ith element in the collection of children of $fRef;
All the other methods deals with the ith element of the $fRef collection:
var sup = $fRef[i].children("sup");
tries to call the function children on the ith element of the jQuery collection $fRef, but that element is a classic Dom Element so it doesn't have any children method.
var sup = $fRef.eq(i).children("sup");
does the same thing as 2 but correctly as eq will return a jQuery object. It retrieves all the children of the ith element of $rFref
var sup = $fRef.get(i).children("sup");
The get method does the same as the index: it gets the dom object so it won't work either.
var sup = $($fRef[i]).children("sup");
will also work as 3 as you rewrap the html collection in a dom element. It's really unefficient though
Post a Comment for "JQuery: Array[i].children() Is Not A Function"