MCPcopy Index your code
hub / github.com/devote/HTML5-History-API / anchorTarget

Function anchorTarget

history.js:951–956  ·  view source on GitHub ↗

* Finds the closest ancestor anchor element (including the target itself). * * @param {HTMLElement} target The element to start scanning from. * @return {HTMLElement} An element which is the closest ancestor anchor.

(target)

Source from the content-addressed store, hash-verified

949 * @return {HTMLElement} An element which is the closest ancestor anchor.
950 */
951 function anchorTarget(target) {
952 while (target) {
953 if (target.nodeName === 'A') return target;
954 target = target.parentNode;
955 }
956 }
957
958 /**
959 * Handles anchor elements with a hash fragment for non-HTML5 browsers

Callers 1

onAnchorClickFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected