0
Can we use \n \t (escape characters ) in document.write() method?
2 ответов
+ 3
No. document.write() will not allow \n or \t as escape characters. It will throw error instead.
Uncaught SyntaxError: Invalid or unexpected token.
+ 1
Nope. They won't be translated into HTML. If you want to create newlines in your page, better to use "<br/>", as seen here. Since there are no tabs in HTML, you'll need to create a class in CSS, and reference it in your string. Alternatively, you *might* be able to use x number of in succession, although I'm not sure that will work either.