1 function getStyle(elem
, name
) {
2 if (document
.defaultView
&& document
.defaultView
.getComputedStyle
) {
3 name
= name
.replace(/([A-Z])/g, '-$1');
4 name
= name
.toLowerCase();
7 var s
= document
.defaultView
.getComputedStyle(elem
, '');
8 return s
&& s
.getPropertyValue(name
);
17 var bElement
= document
.getElementById('test1');
18 var display
= getStyle(bElement
, 'display').toLowerCase();
19 document
.title
= display
;