How to make a text italic using JavaScript?

JavascriptWeb DevelopmentFront End Technology

To make text italic using JavaScript, use the italics() method. This method causes a string to be italic as if it were in an <i> tag.


You can try to run the following code to make a text italic with JavaScript −

Live Demo

      <title>JavaScript String italics() Method</title>

         var str = new String("Demo Text");
Updated on 15-Jun-2020 06:51:05