JavaScript italics()Method
JavaScript String Object
Definition and Usage
The italics() method is used to display a string in italic.
This method returns the string wrapped in an <i> tag, as shown below:
<i>string</i>
Syntax
string.italics()
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the italics() method.
Example
Example
Display a string in italic:
<script>
var str = "Hello world!";
document.write(str.italics());
</script>
var str = "Hello world!";
document.write(str.italics());
</script>
Try it Yourself »
JavaScript String Object
Other Extensions