From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/string/fixed/index.html | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/string/fixed/index.html (limited to 'files/ja/web/javascript/reference/global_objects/string/fixed') diff --git a/files/ja/web/javascript/reference/global_objects/string/fixed/index.html b/files/ja/web/javascript/reference/global_objects/string/fixed/index.html new file mode 100644 index 0000000000..ed7e2d2576 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/string/fixed/index.html @@ -0,0 +1,67 @@ +--- +title: String.prototype.fixed() +slug: Web/JavaScript/Reference/Global_Objects/String/fixed +tags: + - Deprecated + - HTML wrapper methods + - JavaScript + - Method + - Prototype + - Reference + - String +translation_of: Web/JavaScript/Reference/Global_Objects/String/fixed +--- +
{{JSRef}} {{deprecated_header}}
+ +

fixed() メソッドは、文字列を等幅フォントで表示させる HTML の {{HTMLElement("tt")}} 要素を生成します。

+ +

構文

+ +
str.fixed()
+ +

返値

+ +

HTML の {{HTMLElement("tt")}} 要素を含む文字列です。

+ +

解説

+ +

fixed() メソッドは、文字列を <tt> 要素の中に、 "<tt>str</tt>" のように埋め込みます。

+ +

+ +

fixed() の使用

+ +

下記の例は、 fixed メソッドを使用して文字列の表示方法を変更します。

+ +
var worldString = '世界のみなさん、こんにちは!';
+console.log(worldString.fixed()); // "<tt>世界のみなさん、こんにちは!</tt>"
+
+ +

仕様書

+ + + + + + + + + + + + +
仕様書
{{SpecName('ESDraft', '#sec-string.prototype.fixed', 'String.prototype.fixed')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("javascript.builtins.String.fixed")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf