worldtraveller
12-06-2010, 03:58 AM
I need to create a function with named getFontSize()
needs one parameter named "id"
and id is value of object in document
then to create a variable named object to represent object
return font size of text in object
use style object to retrieve font size
and use parseInt() function to get value of font size
this is the code i came up with
function getFontSize(id) {
// Returns the font size of the object with the value id
var object=document.getElementById(id);
fontsize=parseInt(object.style.fontSize);
return(fontsize);
}
What should i change to make work/
needs one parameter named "id"
and id is value of object in document
then to create a variable named object to represent object
return font size of text in object
use style object to retrieve font size
and use parseInt() function to get value of font size
this is the code i came up with
function getFontSize(id) {
// Returns the font size of the object with the value id
var object=document.getElementById(id);
fontsize=parseInt(object.style.fontSize);
return(fontsize);
}
What should i change to make work/