italics()

The italics() method is used to display the string of text in an italicized version of the font chosen within the browser. The string is treated as though it were encompassed within the opening and closing HTML tags.

syntax:

stringName.italics()

EXAMPLE

var newString = new String("This is the string text.");

document.write(newString.italics() )

The example first creates a new string called newString. It is then written to the screen via a document.write statement with the italics() method being performed upon the contents of newString before being displayed. The output should look like the following:



This is the string text.