[JS] Firefox `parentElement` property

Firefox returns undefined when i use obj.parentElement, where obj is passed to a function and is a valid html object.

Is there a work-around ? Is this a bug in Firefox, or is it a bug in my script ?

Thank you.