title: Is `event.target` guaranteed to be a descendant of / equal to `this` in event callbacks like "click" in JavaScript?
body: <p>If I recurse through <code>.parentNode</code> of <code>event.target</code>, am I guaranteed to reach <code>this</code>? Is this mentioned anywhere in the spec?</p>
  <p>Here's some code to demonstrate this, which will log if <code>event.target</code> is a descendent of <code>this</code>:</p>
  <p><a href="http://jsfiddle.net/Dogbert/aRLrG/" rel="nofollow noreferrer">http://jsfiddle.net/Dogbert/aRLrG/</a></p>
  <pre><code>var isADescendentOf = function (child, parent) {
      if (child === parent) {
          return true;
      }
      if (child === null) {
          return false;
      }
      return isADescendentOf(child.parentNode, parent);
  };
  
  
  var nodes = document.querySelectorAll(&quot;*&quot;);
  
  for (var i = 0; i &lt; nodes.length; i++) {
      nodes[i].addEventListener(&quot;click&quot;, function (event) {
          console.log(isADescendentOf(event.target, this));
      });
  }
  </code></pre>
  <p>HTML</p>
  <pre><code>&lt;div id=&quot;a&quot;&gt;A
      &lt;div id=&quot;b&quot;&gt;B
          &lt;div id=&quot;c&quot;&gt;C
              &lt;div id=&quot;d&quot;&gt;D
                  &lt;div id=&quot;e&quot;&gt;E&lt;/div&gt; &lt;span id=&quot;f&quot;&gt;F&lt;/span&gt;
  
                  &lt;button&gt;B&lt;/button&gt; &lt;span&gt;1&lt;span&gt;2&lt;span&gt;3
                  &lt;/span&gt;&lt;/span&gt;
                  &lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>