G
George Hester
I have this in a style sheet:
div.track { font-family: Verdana, Arial, Helvetica, sans-serif; }
In a JavaScript function I can pull out Verdana, Arial, Helvetica, sans-serif putting it
into a JavaScript variable fontfamily.
But what I would prefer is an array fontfamily[] where each font-family is an element
of the array.
I tried
var fontfamily = new Array(getComputedStyleForElement(document.getElementById('divTrack'),'fontFamily'));
but no dice. This is a one element Array with
fontfamily[0] = Verdana, Arial, Helvetica, sans-serif
What I was hoping for was:
fontfamily[0] = Verdana
fontfamily[1] = Arial
fontfamily[2] = Helvetica
fontfamily[3] = sans-serif
Any neat ideas how I might do this?
Thanks.
div.track { font-family: Verdana, Arial, Helvetica, sans-serif; }
In a JavaScript function I can pull out Verdana, Arial, Helvetica, sans-serif putting it
into a JavaScript variable fontfamily.
But what I would prefer is an array fontfamily[] where each font-family is an element
of the array.
I tried
var fontfamily = new Array(getComputedStyleForElement(document.getElementById('divTrack'),'fontFamily'));
but no dice. This is a one element Array with
fontfamily[0] = Verdana, Arial, Helvetica, sans-serif
What I was hoping for was:
fontfamily[0] = Verdana
fontfamily[1] = Arial
fontfamily[2] = Helvetica
fontfamily[3] = sans-serif
Any neat ideas how I might do this?
Thanks.