Get Bold Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Bold


The Bold object represents an HTML <b> element.

You can access a <b> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<b id="myB">this bold text</b>

<button onclick="myFunction()">Test</button>

function myFunction() {//  ww w.  j a  v  a 2s  .co  m
    var x = document.getElementById("myB"); = "red"; = "1px blue solid";


Related Tutorials