JavaScript中的bold()方法使用详解

 此方法将导致就好像它是在一个<b>标签的字符串显示为粗体。
语法

string.bold( )


下面是参数的详细信息:

  •     NA:

返回值:

  •     返回字符串含有<b>标签

例子:

<html>
<head>
<title>JavaScript String bold() Method</title>
</head>
<body>
<script type="text/javascript">

var str = new String("Hello world");

alert(str.bold());

</script>
</body>
</html>


这将产生以下结果:

<b>Hello world</b>