Metoda kotwica JavaScript ()
Definicja i Wykorzystanie
Sposób kotwiący () stosuje się w celu utworzenia kotwy HTML.
Metoda ta zwraca ciąg <a> dodawania tagów, co następuje:
<a name="anchorname"> ciąg </a>
gramatyka
string.anchor(name)
参数 | 描述 |
---|---|
name | Required. The name of the anchor |
Pomoc Browser
Wszystkie główne przeglądarki obsługują metody anchor ().
Przykłady
Przykłady
Załóż kotwicę HTML:
<script>
var txt = "Chapter 10";
txt.anchor("chap10");
alert(txt.anchor("chap10"));
</script>
var txt = "Chapter 10";
txt.anchor("chap10");
alert(txt.anchor("chap10"));
</script>
Spróbuj »
JavaScript String Object