 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a bold text using JavaScript?
To create a bold text using JavaScript, use the bold() text. This method causes a string to be displayed as bold as if it were in a <b> tag.
Example
You can try to run the following code to create a bold text with JavaScript −
<html>
   <head>
      <title>JavaScript String bold() Method</title>
   </head>
   <body>
      <script>
         var str = new String("Demo Text");
         document.write(str.bold());
         alert(str.bold());
      </script>
   </body>
</html>Advertisements
                    