Home > Web Front-end > JS Tutorial > body text

javascript bold()将字体加粗

WBOY
Release: 2016-06-01 09:54:41
Original
6715 people have browsed it

bold 方法

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

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

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

实例

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

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

在线运行

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!