最新のWeb開発のチュートリアル
 

JavaScript弦link() Method

<JavaScriptの文字列リファレンス

テキスト表示: "Free Web Building Tutorials!" ハイパーリンクのように:

var str = "Free Web Building Tutorials!";
var result = str.link("http://www.w3ii.com");
»それを自分で試してみてください

もっと"Try it Yourself"以下の例。


定義と使用法

link()メソッドは、標準ではなく、すべてのブラウザで期待どおりに動作しない場合があります。

link()メソッドは、ハイパーリンクなどの文字列を表示するために使用されます。

このメソッドは、に埋め込まれた文字列を返す<a>このように、タグを:

<a href="url">文字列</a>に


ブラウザのサポート

方法
link() はい はい はい はい はい

構文

パラメータ値
パラメーター 説明
url 必須。 リンク先のURL

技術的な詳細

戻り値: 中に埋め込まれた文字列<a>タグ
JavaScriptのバージョン: 1.0

例

その他の例

関連した方法のデモンストレーション:

var txt = "Hello World!";

document.write("The original string: " + txt);
document.write("<p>Big: " + txt.big() + "</p>");
document.write("<p>Small: " + txt.small() + "</p>");
document.write("<p>Bold: " + txt.bold() + "</p>");
document.write("<p>Italic: " + txt.italics() + "</p>");
document.write("<p>Fixed: " + txt.fixed() + "</p>");
document.write("<p>Strike: " + txt.strike() + "</p>");
document.write("<p>Fontcolor: " + txt.fontcolor("green") + "</p>");
document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>");
document.write("<p>Subscript: " + txt.sub() + "</p>");
document.write("<p>Superscript: " + txt.sup() + "</p>");
document.write("<p>Link: " + txt.link("http://www.w3ii.com") + "</p>");
document.write("<p>Blink: " + txt.blink() + " (works only in Opera)</p>");
»それを自分で試してみてください

<JavaScriptの文字列リファレンス