64
rated 0 times
[
70]
[
6]
/ answers: 1 / hits: 80565
/ 13 Years ago, mon, march 19, 2012, 12:00:00
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.
More From » jquery