Yesterday I had some great help from aj_nsc to create a text node to display the output of a function. Whilst it works perfectly, I lack a bit of understanding about how it actually works, which means I’m struggling when it comes to developing the code to implement formatting.
Could anyone explain how this is doing what it is doing?
[code=html]
var text = “Alter the exposure by ” + film[ftype][iso][exp] + ” stops”;
var node = document.createElement(“span”);
node.id = hidden;
if(!(document.getElementById(hidden))) {
document.body.appendChild(node);
}
document.getElementById(hidden).innerHTML = text;
As for formatting I would like the outputted text to centered.
[code=html]
variable.setAttribute(“align”,”centre”);
I’m pretty sure thats what I need to use in order to do this, but im not sure as to which variable to set this to, or how to control the span element in general.
Any help would be great.