I'm looking to customize the default header of a div using a JavaScript function, but the final result of my code is displaying as [object HTMLDivElement]. Here's the code snippet I'm working with:
function CustomizeHeader(){
var div=document.createElement('div');
var logo = document.createElement('img');
logo.height=80;
logo.width=250;
logo.src="persona-5-listing-thumb-01-ps4-us-30jun16.png";
var dataContainer= document.createElement('div');
var taxID = document.createElement('span');
var address = document.createElement('span');
var phone = document.createElement('span');
taxID.innerHTML = "Tax ID: ";
address.innerHTML = "Sample Address";
phone.innerHTML = "Phone Number: ";
dataContainer.appendChild(taxID);
dataContainer.appendChild(address);
dataContainer.appendChild(phone);
var subDocument=document.createElement('div');
subDocument.border="2px solid "+colorBorder;
var rD = document.createElement('span');
rD.innerHTML="tax ID";
var tD = document.createElement('p');
tD.innerHTML = "HEADER";
subDocument.appendChild(rD);
subDocument.appendChild(tD);
div.appendChild(logo);
div.appendChild(dataContainer);
div.appendChild(subDocument);
document.getElementById('header').innerHTML = div;
}