For example, I have some function:
var inputA = document.getElementById("A").value;
var inputB = document.getElementById("B").value;
document.write("First input is: " + inputA + '<br />');
document.write("Second input is: " + inputB + '<br />');
So, in this case I use document.write(), but with several these functions it gets messed up. This document.write() overwrites my parent html page. How to set it up to open in a new page/tab. Or how to use document.close() in this situation in order to work properly.
Should I use some better method, which will also have the same functionality as this one. I want to set up a variable that will print a line of text, code, numbers etc. in the desired position of a page.