How to make a text italic using JavaScript ? Last Updated : 25 Jul, 2024 Comments Improve Suggest changes Like Article Like Report Javascript provides various methods to modify the text according to our need. In this article, we are going to see how we can make the text italics in javascript. string.italics( ) is the method use to make the text italics. Basically, italics text are created by using the <i> </i> tag in the html. So, the string.italics( ) method creates an HTML element consisting of <i> </i> tag.Syntax:string.italics()Here, "string" is the name of the variable.Parameter: This method doesn't take any parameters.Return Value: This method returns a String that is embedded in an <i> element.Example: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Italics Example</title> </head> <body> <h1>How to use italics() in Javascript</h1> <p id="original-text">Geeks for geeks</p> <p id="italic-text"></p> <script> // Original string let originalString = "Geeks for geeks"; // Apply italics() method to italicize the string let italicString = originalString.italics(); // Display the italicized string in the HTML document.getElementById("italic-text").innerHTML = italicString; </script> </body> </html> Output: Use of italics( ) Comment More infoAdvertise with us Next Article How to change font-weight of a text using JavaScript ? D darksiderrohan Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Questions Similar Reads How to Change Text Inside all HTML Tags using JavaScript ? In this article, we will learn how to change the text content inside all HTML tags using JavaScript. This skill is valuable when you need to dynamically modify the text displayed on a web page. which can be useful for various scenarios like updating content, internationalization, or creating dynamic 3 min read How to process each letter of text using JavaScript ? Given a string and the task is to process it character by character. JavaScript String toUpperCase() Method: This method converts a string to uppercase letters. Syntax: string.toUpperCase()Parameters: This method accepts single parameter str which is required. It specifies the string to be searched. 2 min read How to change font-weight of a text using JavaScript ? In this article, we will set the font-weight of a text dynamically using JavaScript. Ti change the font weight dynamically, we use HTML DOM Style fontWeight property. Syntax: object.style.fontWeight = "value" Property Values: normal: The font weight is the default value.lighter: The font weight is t 1 min read How to Underline Text of a Div Element in JavaScript ? Underlining text of a div can help to emphasize certain words or phrases and make them stand out from the rest of the content on the page. To underline text in a div element using JavaScript, you can use the style property of div to text-decoration. Text Decoration: The text-decoration property is u 3 min read How to Add Text Formatting to a Textarea using JavaScript? To add text formatting (such as bold, italic, or inserting special characters) to a <textarea> using JavaScript, you can manipulate the selected text or insert formatted text at the cursor position. This can be done by directly modifying the value of the <textarea> based on user interact 3 min read JavaScript String bold() Method The JavaScript bold() function of string values produces a string that includes this string within a <b> element ( <b>str</b> ), thus making this string be displayed in bold, in HTML5, it is supported, but for more complicated styling CSS is usually the best choice. Note: String bo 1 min read Like