Übersicht: Blend4Web


  1. create a timestamp
  2. divide the time into parts of seconds, minutes and hours
  3. save true or false for each Element
  4. color the clock elements
function load_cb(data_id, success) {

 if (!success) {
     console.log("b4w load failure");


 // place your code here



Underneath of the function load_cb create your own code. Create two new functions myclock and getTimeStamp at the beginning:

function myclock () {

  // coloring all parts of the clock for a timestamp
  var ts = getTimeStamp ();
  console.log('myclock called');

function getTimeStamp (){

  // get all parts of the actual time

  console.log('getTimestamp called');

The function myclock is calling getTimeStamp, don't forget to add myclock() in the function load_cb (see also the comment)

Start the file in the browser...


... and open the developer console...


... you now should see the output of console.log.