HTML DOM Bold Object Last Updated : 16 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Bold Object is used to represent the HTML <b> element. The bold element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where "id" is the ID assigned to the "b" tag. Example 1: In this example, we will use HTML DOM Bold Object HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Bold Object </title> </head> <body> <b></b> <h1 id="GFG">GeeksForGeeks</h1> <h2 style="font-size:35px;">DOM Bold Object</h2> <br> <button onclick="myGeeks()"> Submit </button> <p id="geeks"></p> <script> function myGeeks() { let b = document.getElementById("GFG"); b.style.backgroundColor = "red"; } </script> </body> </html> Output: Example 2: Bold Object can be created by using the document.createElement Method. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Bold Object </title> </head> <body> <h1>GeeksForGeeks</h1> <h2>DOM Bold Object</h2> <button onclick="myGeeks()"> Submit </button> <p id="sudo"></p> <!-- script for Bold Object --> <script> function myGeeks() { let G = document.createElement("B"); let F =document.createTextNode("GeeksForGeeks"); G.appendChild(F); document.body.appendChild(G); } </script> </body> </html> Output: Supported Browsers: The browser supported by DOM Bold Object are listed below: Google ChromeInternet ExplorerFirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM normalizeDocument() Method M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML Web technologies HTML-DOM +1 More Practice Tags : Misc Similar Reads HTML DOM Caption Object The DOM Caption Object is used to represent the HTML <Caption> element (A caption element is used to specify the caption of a table). The Caption element is accessed by getElementById(). Properties: It has a align Attribute which is used to set or return the alignment of the caption. Syntax: d 2 min read HTML DOM Canvas Object The DOM Canvas Object is used to represent the HTML <Canvas> element. The <canvas> tag is used to draw graphics in the document using javascript. It is new in HTML5. The canvas element is accessed by getElementById(). Syntax: accessed by getElementById("id"). Where âidâ is the ID assigne 2 min read HTML DOM importNode() Method The HTML | DOM importNode() Method creates a copy of a node from another document and imports it to the current document. Syntax: document.importNode(externalNode, [deep]) Parameters: externalNode: Node which we need to import from another document, it can be of any type.[deep]: We can set its val 2 min read HTML DOM inputEncoding Property The inputEncoding property returns the character encoding used for parsing the document. This property doesn't have any default value. Syntax:document.inputEncodingParameters:The HTML DOM inputEncoding property does not require any parameter.Return Value:The HTML DOM inputEncoding property returns a 2 min read HTML DOM normalizeDocument() Method The normalizeDocument() method in HTML is used to normalize an HTML document by remove any empty text nodes if exists. After removing the empty nodes, it also merges all of the adjacent nodes present in the document. For Example, consider the below element: Element Geeks Text node: "" Text node: "He 2 min read HTML DOM lang Property In HTML document, the lang property is used to set or return the value of the lang attribute of an element. This attribute specifies the language code of the element's content. The element attribute takes "en" for English, "ja" for Japanese, "es" for Spanish, and so on. The default value of this att 2 min read HTML DOM KeyboardEvent key Property The keyboardEvent key property in HTML is used to return the value of the key pressed when a key event occurs. It returns a single-character or multi-character string depending on which key is pressed. It is a read-only property. Syntax: event.key Return Value: It returns a string that represents th 1 min read HTML DOM keyboardEvent charCode Property The keyboardEvent charCode property in HTML is used to return the unicode value of a character key pressed during a keypress event. It is a read-only property. The unicode character denotes the number of a character(e.g. the unicode for "A" is 65). Syntax: event.charCode Note: This property has been 1 min read HTML DOM hasChildNodes() Method The HTML hasChildNodes() property will return true if the given node has a child node or false if it doesn't have any child nodes. A blank line or whitespace is also treated as a child node so it also returns true on a blank line or whitespace. Prerequisite DOM (Document Object Model) Parameters: No 2 min read HTML DOM nodeValue Property The HTML DOM nodeValue Property is used to describe the property of a given node. It is used to set or get the nodeValue in Any Html document. Prerequisites DOM (Document Object Model) Syntax: let x = document.getElementById("nodeId").firstChild; x.nodeType; x.nodeName; x.nodeValue; Parameters: No p 1 min read Like