Example speaks for it self:
function writeSpecialTabContentForTtm(){
document.write('<div style="float:right;width:250px;min-height:200px;display:block;border-width: 1px 1px 1px">');
document.write('<form id="ttmsetpointrun" action="" style="text-align:right">');
document.write('<input style="float:bottom;" type="submit" value="Move to Set Point" />');
document.write('</form>');
document.write('</div>');
How this should be done? There is a form that is chosen by user. To be precise, user choses a tab and when creating a tab the above function is called. This is something that is changed frequently, so it would be nice to write it in a separate file.
edit:
so, in my case it would be:
var newdiv = document.createElement('div');
newdiv.style = "float:right;width:250px;min-height:200px;display:block;border-width: 1px 1px 1px";
document.body.appendChild(newdiv);
var newform = document.createElement('form');
newform.id = "ttmsetpointrun";
newform.action="";
newform.style="text-align:right";
newdiv.appendChild(newform);
var newinput = document.createElement('input');
newinput.style = "float:bottom;";
newinput.type = "submit";
newinput.value = "Move to Set Point";
newform.appendChild(newinput);