Log in Sign up
1 Matching Annotations
  1. Nov 2019
  2. stackoverflow.com stackoverflow.com
    how to get all parent nodes of given element in pure javascript?
    1
    1. TylerRick 25 Nov 2019
      in Public
      var a = document.getElementById("target"); var els = []; while (a) { els.unshift(a); a = a.parentNode; }
      element traversal
    Visit annotations in context

    Tags

    • element traversal

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/8729193/how-to-get-all-parent-nodes-of-given-element-in-pure-javascript
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy