Function getAnchorElement