Share via


anchor, méthode

Retourne une chaîne avec un point d'ancrage HTML et avec l'attribut NAME avant et après le texte spécifié dans l'objet.

function anchor(anchorString : String ) : String

Arguments

  • anchorString
    Obligatoire. Texte à placer dans l'attribut NAME d'un point d'ancrage HTML.

Notes

Appelez la méthode anchor pour créer un point d'ancrage nommé à partir d'un objet String.

Aucune vérification n'est effectuée pour savoir si la balise a déjà été appliquée à la chaîne.

Exemple

L'exemple suivant illustre comment la méthode anchor effectue cette opération :

var strVariable = "This is an anchor";
strVariable = strVariable.anchor("Anchor1");

La valeur de strVariable après la dernière instruction est :

<A NAME="Anchor1">This is an anchor</A>

Configuration requise

Version 1

S'applique à :

String, objet

Voir aussi

Référence

link, méthode