Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.write vs document.writeln

Status
Not open for further replies.

y2k1981

Programmer
Aug 2, 2002
773
IE
can somebody explain to me what's the difference between
Code:
document.write
and
Code:
document.writeln
?????
 
hi y2k1981,

writeln writes a newline at the end. this is generally more useful when writing to textareas rather than html.
=========================================================
if (!succeed) try();
-jeff
 
so would the following both be the same?
Code:
document.write("Hello\n");
document.writeln("Hello");
?
 
yes =========================================================
if (!succeed) try();
-jeff
 
Thanks, I could never seem to figure out the difference

[wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top