var infoDiv = document.getElementById("info");
console.log(window);
console.log(window.location);
infoDiv.textContent += "The URL of this page is " + window.location.href;
// i am hoping the following sentence can start in a new line
infoDiv.textContent += "The user agent is " + window.navigator.userAgent;
I tried document.write("\n")
as people suggested here, but Chrome gives me this violation warning:
[Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
What should I do? Thanks!