document class has following method (there are others like writeln(..) ,etc.) :
document.write("Hi how are you?"); //will print hi how are you to the screen.
documnet.write("<b>Hi, How are you?<b><br>");