Question:

How can I use the Javascript style object to retrieve the font size?

by  |  earlier

0 LIKES UnLike

I want to use the style object to retrieve the font size of the text in the document along with the parseInt() to extract the numeric value of the font size only. I have only been able to figure out how to position using the style object or extract an already given number with the parseInt() function. Can you please help me?

This is the code that I have so far:

function getFontSize(id){

object=document.getElementById(id);

(style object here)

return font size;

}

 Tags:

   Report

1 ANSWERS


  1. I believe it's:

    object.style.fontSize

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.