| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/anchor | [Back] [Original] |
Get to know MDN better
Avoid using this feature in new projects. HTML wrapper methods exist only for backwards compatibility. Use DOM APIs to create elements instead. This feature may be a candidate for removal from web standards or browsers.
Consider using the following features instead: DOM.
anchor() String <a> name (<a name="...">str</a>)
:
HTML DOM API document.createElement()
HTML <a> name
anchor(name)
namename <a name="...">
<a name="name"> name " str </a>
HTML
const contentString = "Hello, world";
document.body.innerHTML = contentString.anchor("hello");
HTML
<a name="hello">Hello, world</a>
:
name <a>
anchor() HTML document.createElement() DOM API
const contentString = "Hello, world";
const elem = document.createElement("a");
elem.innerText = contentString;
document.body.appendChild(elem);
| ECMAScript 2027 LanguageSpecification # sec-string.prototype.anchor |
Stringanchor()at()big()blink()bold()charAt()charCodeAt()codePointAt()concat()endsWith()fixed()fontcolor()fontsize()includes()indexOf()isWellFormed()italics()lastIndexOf()link()localeCompare()match()matchAll()normalize()padEnd()padStart()repeat()replace()replaceAll()search()slice()small()split()startsWith()strike()sub()substr()substring()sup()toLocaleLowerCase()toLocaleUpperCase()toLowerCase()toString()toUpperCase()toWellFormed()trim()trimEnd()trimStart()valueOf()[Symbol.iterator]()Object/Function| Web Proxy Viewer | New URL | Original Page |