此方法使字符串变为斜体,就好像它在<i>标签中一样
string.italics( )
返回带有<i>标签的字符串。
<html> <head> <title>JavaScript String italics() Method</title> </head> <body> <script type="text/javascript"> var str=new String("Hello world"); alert(str.italics( 3 )); </script> </body> </html>
运行上面代码输出
<i>Hello world</i>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)