Javascript examples for String:bold
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>
None.
A string embedded in the <b> tag
The following code shows how to Display a text in bold:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// w w w . j ava 2s. co m var str = "Hello World!"; var result = str.bold(); document.getElementById("demo").innerHTML = result; } </script> </body> </html>