- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML DOM Strong object
The HTML DOM Strong object is associated with the HTML <strong> element. The strong tag is used for strong emphasis and makes the text bold. We can create and access strong element using the createElement() and getElementById() method respectively.
Syntax
Following is the syntax for −
Creating a strong object −
Var s= document.createElement("STRONG");
Example
Let us look at an example for the strong object −
<!DOCTYPE html> <html> <body> <h1>Strong object example</h1> <p>Create a strong element by clicking the below button</p> <button onclick="createStrong">CREATE</button> <p>This is some text inside the p element</p> <script> function createStrong() { var s = document.createElement("STRONG"); var txt = document.createTextNode("This is some text inside the strong element"); s.appendChild(txt); document.body.appendChild(s); } </script> </body> </html>
Output
This will produce the following output −
On clicking the CREATE button −
Advertisements