How to get font size of an element using jQuery ?
In this article, we will see how to get the font size of an element using jQuery. To get the font size of an element, we will use css() method. The css() method is used to set or return the style property of the selected element.
var style = $(selector).css(property)
Return value: This method returns the value of the style property for the selected element.
Approach: In the below example, we will create a div element that contains some text and add some CSS styles (font-size) on it. Also, we will create a button element. When the user clicks on the button, the css() method is called and this method returns the font-size property of the div element.
My Personal Notes arrow_drop_up
Please Login to comment...