Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p>Click the button to display a string in bold.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var str = "Hello World!"; var result = str.bold(); document.getElementById("demo").innerHTML = result; } </script> </body> </html>
Result: