I use jQuery’s event object to get the target’s parent. The code is:
event.target.parentElement
In Chrome it works, but in Firefox, it doesn’t. I use alert() to print the output.
event.target is an URL in both Chrome and Firefox; but event.target.parentElement in Chrome is [Element object], and in Firefox it is null.
What should I do to solve this problem? I still wonder if IE will have this problem?
Thanks.
To access the parent, you could do: