From 52c12c1c3a8a92091f5caadf2cd1cc632b345d39 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sun, 18 Jul 2021 23:58:20 +0900 Subject: Web/API/CSSStyleDeclaration 以下を更新 (#1482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Web/API/CSSStyleDeclaration/cssText を新規翻訳 2021/06/13 時点の英語版に基づき新規翻訳 * Web/API/CSSStyleDeclaration 以下を整備 Web/API/CSSStyleDeclaration 以下について、2021/07/10時点の内容に同期。未翻訳の記事については新規翻訳 --- .../web/api/cssstyledeclaration/csstext/index.html | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 files/ja/web/api/cssstyledeclaration/csstext/index.html (limited to 'files/ja/web/api/cssstyledeclaration/csstext') diff --git a/files/ja/web/api/cssstyledeclaration/csstext/index.html b/files/ja/web/api/cssstyledeclaration/csstext/index.html new file mode 100644 index 0000000000..33cb0c7d90 --- /dev/null +++ b/files/ja/web/api/cssstyledeclaration/csstext/index.html @@ -0,0 +1,36 @@ +--- +title: CSSStyleDeclaration.cssText +slug: Web/API/CSSStyleDeclaration/cssText +tags: + - API + - CSSOM + - NeedsSpecTable + - Reference +browser-compat: api.CSSStyleDeclaration.cssText +translation_of: Web/API/CSSStyleDeclaration/cssText +--- +
{{APIRef("CSSOM")}}
+ +

cssText は {{domxref("CSSStyleDeclaration")}} インターフェイスのプロパティで、その要素のインラインスタイル宣言のみのテキストを返したり設定したりします。スタイルシートの規則を動的に設定するためには、動的なスタイル情報の利用を参照してください。

+ +

スタイルシートのスタイル規則である {{domxref("CSSRule.cssText")}} と混同しないようにしてください。

+ +

+ +
<span id="s1" style="color: red;">
+  Some text
+</span>
+
+<script>
+  var elem = document.getElementById("s1");
+  alert(elem.style.cssText); // "color: red;"
+</script>
+
+ +

仕様書

+ +{{Specifications}} + +

ブラウザーの互換性

+ +

{{Compat}}

-- cgit v1.2.3-54-g00ecf