JavaScript tutorial:
italics method

 

Applies to: String Object

The italics method places HTML <I> tags around text in a String object.

Syntax

strVariable.italics( )
"String Literal".italics( )

Return value

None

Example

The following example demonstrates how the italics method works:

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function ItalicTag()
{
var strVariable = "This is a test";
strVariable = strVariable.italics( );
return strVariable
}
</SCRIPT></HEAD>
<BODY>
<P> See how it work in Html
<SCRIPT LANGUAGE="JavaScript"> document.write(ItalicTag());</SCRIPT> </P>
</BODY>

To run the code, paste it into JavaScript Editor, save as htm file format and click the Execute button.

See also: bold Method, String Object Methods, String Object Properties