How to change font size using jQuery ? Last Updated : 15 May, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will see how to change the font size of an element using jQuery. To change the font size of an element, we will use css() method. The css() method is used to change the style property of the selected element. Syntax: $(selector).css(property) Return value: It will return the value of the property for the selected element. In the below example, we have created a div element that contains some text and also created a button element. When the user clicks on the button, the css() method is called and this method sets the font-size property value to 32px. Example: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content= "width=device-width, initial-scale=1.0"> <!-- Including jQuery --> <script src=" https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> </head> <body> <center> <h1 style="color: green;"> GeeksforGeeks </h1> <h3> How to change font size using jQuery? </h3> <div id="content">Welcome to GeeksforGeeks</div> <br> <button>Change font size</button> </center> <script> $(document).ready(function() { $('button').click(function() { $("#content").css("fontSize", "32px"); }); }); </script> </body> </html> Output: Comment More infoAdvertise with us Next Article How to use resize() function in jQuery ? V vkash8574 Follow Improve Article Tags : JQuery jQuery-Methods HTML-Questions jQuery-Questions Similar Reads How to change cursor style using jQuery ? The cursor style is used to specify the mouse cursor to be displayed while pointing on an element. Cursor Value: alias: This property is used to display the cursorâs indication of something is to be created. all-scroll: In this property, the cursor indicates scrolling. auto: This is the default prop 5 min read 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. Syntax: var style = $(selector).css(property) Return value: This metho 2 min read How to Change Font Size in HTML ? To change the font size of any text we can use the CSS font-size Property, or some HTML keywords have some fixed font size but we change them by using this CSS property. We can use style attributes in the HTML. As we know, HTML has no <font> tag, so we are using CSS style to add font size. The 2 min read How to use resize() function in jQuery ? In this article, we will learn about the resize() method which is an inbuilt method provided by jQuery. This method is used for binding an event listener to the resize event. This event is fired when the size of the browser window changes its size, either by the user or due to some other reason. Thi 2 min read How to change the text alignment using jQuery ? In this article, we will see how to change the text alignment of an element using jQuery. To change the text alignment of an element, we will use css() method. The css() method is used to change the style property of the selected element. Syntax: $(selector).css(property) In the below example, firs 1 min read How to Change the Font Size in HTML? Changing the font size in HTML helps control the readability and visual hierarchy of your content. Earlier, the <font> tag with the size attribute was commonly used for this purpose. However, with the introduction of HTML5, the <font> tag has been deprecated and is no longer recommended. 2 min read Like