JavaScript stringa di riferimento
Esempio
Crea un ancoraggio HTML intorno a una stringa:
var txt = "Chapter 10";
txt.anchor("chap10");
alert(txt.anchor("chap10"));
Prova tu stesso " Definizione e utilizzo
L' anchor() metodo non è standard, e potrebbe non funzionare come previsto in tutti i browser.
The anchor() metodo viene usato per creare un ancoraggio HTML.
Questo metodo restituisce la stringa incorporato nel <a> tag, in questo modo:
<a stringa name="anchorname"> </a>
Supporto per il browser
metodo | |||||
---|---|---|---|---|---|
anchor() | sì | sì | sì | sì | sì |
Sintassi
string.anchor(" name ")
valori dei parametri
Parameter | Description |
---|---|
name | Required. The name of the anchor |
Dettagli tecnici
Valore di ritorno: | Una stringa incorporato nel <a> tag |
---|---|
Versione JavaScript: | 1.0 |
