Home >Web Front-end >JS Tutorial >javascript bold()将字体加粗

javascript bold()将字体加粗

WBOY
WBOYOriginal
2016-06-01 09:54:416741browse

bold 方法

bold 方法把 HTML 标记放置在 String 对象中的文本两端。

<code class="language-javascript">strVariable.bold()</code>

必选项 strVariable 参数可以是任意的 String 对象或文字。

实例

下面的示例说明了 bold 方法是如何工作的:

<code class="language-javascript">var strVariable = "This is a string object"; 
strVariable = strVariable.bold( );</code>

在线运行

最后一条语句执行完后,strVariable 的值是:

<code class="language-html"><b>This is a string object</b></code>

bold 方法不检查该标记是否已经被应用于该字符串了。 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn