Javascript examples for DOM HTML Element:Bold
The Bold object represents an HTML <b> element.
You can access a <b> element by using getElementById():
<!DOCTYPE html> <html> <body> <b id="myB">this bold text</b> <button onclick="myFunction()">Test</button> <script> function myFunction() {// ww w. j a v a 2s .co m var x = document.getElementById("myB"); x.style.color = "red"; x.style.border = "1px blue solid"; } </script> </body> </html>