How To Use String Object Italics In JavaScript

In this article I am going to explain about String Object Italics method In JavaScript.
  • 1428

Use italics() method in JavaScript

If we want to display a string in a italic then we can use a italic() method.

The <i> tag is used to return a string in JavaScript, like this:


All browsers support string object italics() method.




<!DOCTYPE html>


<body Style="background-color:red">


<p id="demo">Click here</p>

<button onclick="myFunction()">Try it</button>

<script type="text/javascript">

    function myFunction()


        var txt = "Italics:Hello World";

        document.getElementById("demo").innerHTML = txt.italics();  









Further Readings

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.