質問編集履歴
4
追記
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -14,6 +14,9 @@ 
     | 
|
| 
       14 
14 
     | 
    
         
             
            使用言語:html,css,javascript
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
            例)
         
     | 
| 
      
 17 
     | 
    
         
            +
            **html**
         
     | 
| 
      
 18 
     | 
    
         
            +
            <div class="example" id="example"></div>
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
       17 
20 
     | 
    
         
             
            **stylesheet.css**
         
     | 
| 
       18 
21 
     | 
    
         
             
            .example {
         
     | 
| 
       19 
22 
     | 
    
         
             
              color: black;
         
     | 
| 
         @@ -30,7 +33,7 @@ 
     | 
|
| 
       30 
33 
     | 
    
         
             
            参考url。
         
     | 
| 
       31 
34 
     | 
    
         
             
            https://lab.syncer.jp/Web/API_Interface/Reference/IDL/CSSStyleDeclaration/getPropertyValue/#IDL-CSSOMString
         
     | 
| 
       32 
35 
     | 
    
         
             
            ``` 
         
     | 
| 
       33 
     | 
    
         
            -
            var element = document.getElementById( " 
     | 
| 
      
 36 
     | 
    
         
            +
            var element = document.getElementById( "example" ) ;
         
     | 
| 
       34 
37 
     | 
    
         | 
| 
       35 
38 
     | 
    
         
             
            var cssStyleDeclaration = getComputedStyle( element, null ) ;
         
     | 
| 
       36 
39 
     | 
    
         | 
3
追記
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         @@ -27,9 +27,18 @@ 
     | 
|
| 
       27 
27 
     | 
    
         
             
            実際はホームページの制作なので、あくまで一部を切り取り、シンプルに変更したものです。
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
            ### 試したこと
         
     | 
| 
       30 
     | 
    
         
            -
            参考url 
     | 
| 
      
 30 
     | 
    
         
            +
            参考url。
         
     | 
| 
       31 
31 
     | 
    
         
             
            https://lab.syncer.jp/Web/API_Interface/Reference/IDL/CSSStyleDeclaration/getPropertyValue/#IDL-CSSOMString
         
     | 
| 
      
 32 
     | 
    
         
            +
            ``` 
         
     | 
| 
      
 33 
     | 
    
         
            +
            var element = document.getElementById( ".example" ) ;
         
     | 
| 
       32 
34 
     | 
    
         | 
| 
      
 35 
     | 
    
         
            +
            var cssStyleDeclaration = getComputedStyle( element, null ) ;
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            var a = cssStyleDeclaration.getPropertyValue( "color" ) ; 
         
     | 
| 
      
 38 
     | 
    
         
            +
            ```
         
     | 
| 
      
 39 
     | 
    
         
            +
            のような形で記述しましたが、動作せず。
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
       33 
42 
     | 
    
         
             
            ### 補足情報(FW/ツールのバージョンなど)
         
     | 
| 
       34 
43 
     | 
    
         | 
| 
       35 
44 
     | 
    
         
             
            ここにより詳細な情報を記載してください。
         
     | 
2
タイトルの変更
    
        title	
    CHANGED
    
    | 
         @@ -1,1 +1,1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            javascriptで変更後のcssの属性値を取得したい
         
     | 
    
        body	
    CHANGED
    
    | 
         
            File without changes
         
     | 
1
タグの編集
    
        title	
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        body	
    CHANGED
    
    | 
         
            File without changes
         
     |