Add this to the HTML section:
<div id="console-log"></div>
Add this to the JavaScript section:
var consoleLine = "<p class=\"console-line\"></p>";
console = {
log: function (text) {
$("#console-log").append($(consoleLine).html(text));
}
};
Optionally, add this to the CSS to make it more user friendly:
.console-line
{
font-family: monospace;
margin: 2px;
}
You can see an example here.