Make JavaScript link open in new window with document.write

I’m to figure out how to code so that the link opens into a new window? Is this the correct way to do that?

  var copyright = "&copy; ";
  var d = new Date();
  var n = d.getFullYear();
  var db = " Doing Business";
  var str = new String(" Link");
  document.write(copyright + n +""));


Please stop using It’s old, deprecated, and smelly. It also doesn’t support what you are trying to do.

You can construct a link with the appropriate target attribute (read more) to open in a new tab as follows:

var myLink = "<a target='_blank' href=''>Link</a>";
document.write(copyright + n + " " + myLink);