JavaScript String link()
Example
let text = "Free Web Building Tutorials!";
let result = text.link("https://www.w3schools.com");
Try it Yourself »
Description
String link() is deprecated in JavaScript.
Avoid using it.
It may cease to work in your browser at any time.
The link()
method returns a string embedded in an <a> tag:
<a href="url">string</a>
Syntax
string.link("url")
Parameters
Parameter | Description |
url | Required. The URL to link to. |
Return Value
A string embedded in an <a> tag. |
❮ JavaScript String Reference