I was interrupted when I wrote my answer and forgot to add what I was initially going to say. I decided to write a new reply instead of editing the above, not to confuse anyone and keep the two apart.
There is another way to update the content of an element (that has been created in getDom before):
Example 3, .innerHTML:
start: function() {
// stays the same as above
setTimeout(function() {
this.magicContent(self); // this will call the function "magicContent"
}, 10 * 1000); // 10 seconds after the start, 5 seconds after "buildContent"
},
// we don't touch getDom or buildContent!
magicContent: function() {
document.getElementById("my-content").innerHTML = "Changed <i><b>yet again!";
}
document.getElementById(“my-content”).innerHTML = “content”; will update the selected element (the div with the id “my-content”) with the selected content without having to call updateDom().
Keep in mind that this will only work on elements that were created before in getDom, so it will not work within start: function() …
Caution! This can also update elements of other modules, so be careful and use unique IDs.