Search w3schools.com:

SHARE THIS PAGE

JavaScript bold() Method

String Object Reference JavaScript String Object

Definition and Usage

The bold() method is used to display a string in bold.

This method returns the string embedded in the <b> tag, like this:

<b>string</b>

Syntax

string.bold()


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The bold() method is supported in all major browsers.


Example

Example

Display a text in bold:

<script>

var str = "Hello world!";
document.write(str.bold());

</script>

Try it yourself »


String Object Reference JavaScript String Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]