参考链接: http://stackoverflow.com/questions/26195091/determine-event-path-in-dom-event-bubbling
If event’s target attribute value is participating in a tree, let event path be a static ordered list of all its ancestors in tree order, and let event path be the empty list otherwise.
var red = document
.getElementById(
"red" ),
green = document
.getElementById(
"green" ),
msg = document
.querySelector(
"p" )
red
.addEventListener(
"click", function( evt ) {
msg
.textContent =
"'" + evt
.target.id +
"' got poked, and 'green' was" +
// access to the event path
( ~evt
.path.indexOf( green ) ?
"" :
"n't" ) +
" in the path."
}, false )