Syntax string.anchor(name) The anchor() method converts the string to an instance of the tag, setting the NAME attribute to the name that is passed.