CSSStyleDeclaration cssText プロパティ
例
h1 要素のインラインスタイル値を返します:
var elmnt = document.getElementsByTagName("h1")[0];
var x = elmnt.style.cssText;
試してみる »
定義と使用
cssText プロパティは、要素のインラインスタイルを設定または返すために使用されます。
ブラウザサポート
| プロパティ | |||||
|---|---|---|---|---|---|
| cssText | Yes | Yes | Yes | Yes | Yes |
構文
cssText プロパティを返す:
element.style.cssText
cssText プロパティを設定する:
element.style.cssText = style
技術詳細
| DOM バージョン: | Level 2 Style CSS |
|---|---|
| 戻り値: | 指定された要素のインラインスタイルを表す文字列。 |
CSS CSSStyleDeclaration