node2:/var/www/html/js#cat h36.html
<body>
<img id="example" src="images/h36.jpg" alt="A bolt of lightning"/>
<script>
function formatDate(date) {
return (date.getHours() < 10 ? '0' : '') + date.getHours() +
':' + (date.getMinutes() < 10 ? '0' : '') + date.getMinutes() +
':' + (date.getSeconds() < 10 ? '0' : '') + date.getSeconds() +
'.' + (date.getMilliseconds() < 10 ? '00' : (date.getMilliseconds() < 100 ? '0' : '')) +
date.getMilliseconds();
}
document.getElementById('example').onmouseover = function(event) {
console.log('At ' + formatDate(new Date()) + ' Crackle!');
};
</script>
</body>