I am trying to obtain the innerText of a 'TD' element by using jQuery's parents() and find().
allTitles = $("[href='/myLink/param?foo=1234']").parents("table:first").parents("table:first").find(".field_text");
name = allTitles[0].children[0].innerText;
console.log(name);
The code works fine in Chrome, but in Firefox the console prints out "null".
I did some debugging and the problem seems to be in the parents() function. While in Chrome I get all the attributes from the table elements, in Firefox it seems like the attributes are not being read and therefore resulting in "null" when we call find(".field_text").
Why does Chrome and Firefox behave differently event though I am using the same jQuery file?