javascript手冊-i[2]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 longj 的 blog

/ref_m-q.htm#parsefloat_method">parsefloat, parseint functions


italics method

causes a string to be italicized as if it were in an <i> tag.

语法

stringname.italics()

stringname is any string or a property of an existing object.

method of

string

描述

use the italics method with the write or writeln methods to format and display a string in a document.

例子

the following example uses string methods to change the formatting of a string:
var worldstring="hello, world"

document.write(worldstring.blink())
document.write("<p>" + worldstring.bold())
document.write("<p>" + worldstring.italics())
document.write("<p>" + worldstring.strike())

the previous example produces the same output as the following htm:

<blink>hello, world</blink>
<p><b>hello, world</b>
<p><i>hello, world</i>
<p><strike>hello, world</strike>

相关

  • blink, bold, strike methods
  • 本文关键:javascript
     

    本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

    go top