2012-11-15 3 views
1

DOM을 사용하여 font-weight 속성에 액세스하는 데 문제가 있습니다.DOM을 사용하여 font-weight 속성에 액세스 할 수 없습니다

html = 
(Ltrim 
    <html> 
    <head> 
    <style type="text/css"> 
    #bar{ 
     border: 1px solid black; 
    } 
    div { 
     font-weight: bold; 
    } 
    </style> 
    </head> 
    <body><div>foo</div><p id="bar">bar</p></body> 
    </html> 
) 

doc := ComObjCreate("HTMLfile") 
doc.write(html) 
msgbox % doc.styleSheets[0].rules[0].style.border   ; "black 1px solid" 
msgbox % doc.styleSheets[0].rules[1].style.font-weight  ; nothing 
msgbox % doc.styleSheets[0].rules[1].style["font-weight"] ; "[object]" 

이렇게하면됩니까? 아니면 마지막 두 메시지 상자에 "굵게"값이 표시되어야합니까?

답변

관련 문제