Trying to get this function to output to the textarea below. The current code below works, but it takes over the whole page rather than outputting to a text field. I am aware that the two are not properly hooked up. I have hacked around with this for quite some time and it is driving me insane now so this is the last stable version of this script.
Any advice?
function doStuff()
{
var clkUrl = document.getElementById("clkUrl");
var clkName = clkUrl.value;
var assetUrl = document.getElementById("banUrl");
var assetName = assetUrl.value;
var impUrl = document.getElementById("impPix");
var impName = impUrl.value;
document.write('<a href="'+clkName+'" target="_blank">'+'<br>');
document.write('<img src="'+assetName+'">'+'<br>');
document.write('</a>'+'<br>');
document.write('<img src="'+impName+'">'+'<br>');
}
<input name="maininput" id="clkUrl" type="text" placeholder="Click Tracker" autofocus>
<br>
<input id="banUrl" type="text" placeholder="Asset URL">
<br>
<input id="impPix" type="text" placeholder="Impressions Pixel">
<br>
<input type="button" value="Get iFrame" onClick="doStuff()">
<br><br>
<textarea id="iframeoutput" rows="8" cols="50"></textarea>