Printing the value from a variable onto a page

How do I print the value of variable ‘output’ onto the screen
<!doctype html>

BOLT var output;

Sensor data

Read Sensor on PIN-4
< < printing the value of output on screen >>

i am assuming you want to debug the output, the easiest way is to use console.log function, it prints the output to the developer console that can be accessed by pressing F12 in chrome or firefox or by right clicking and selecting developer console.

You can also use document.getElementById('elementID') then use the innerHTML property to add more text to the element.