Search w3schools.com:

SHARE THIS PAGE

JavaScript italics() method

String Object Reference JavaScript String Object

Definition and Usage

The italics() method is used to display a string in italic.

This method returns the string embedded in the <i> tag, like this:

<i>string</i>

Syntax

string.italics()


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The italics() method is supported in all major browsers.


Example

Example

Display text in italic:

<script>

var str = "Hello world!";
document.write(str.italics());

</script>

Try it yourself »


String Object Reference JavaScript String Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]