I want to ask how I can print a Javascript variable in HTML form (e.g. output it on the screen)?
Here is my JS code:
Assuming you have a somewhere in your HTML, you want to run JavaScript after the DOM has loaded which adds the value you want to that div. In jQuery (which you specified in your question you're using), this would simply be:
$('div#example').html(myPlayer.duration());
Here's a fiddle: http://jsfiddle.net/RyanJW/QjXKL/2/