how to set text to div element using javascript code example Example: javascript set text of div document.getElementById("content").innerHTML = "whatever";