SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Newbie, LineBreak
-
May 6, 2008, 15:05 #1
Newbie, LineBreak
Code:document.write ("a=",a," and b=",b,"<br />");
Code:document.write ("a=",a," and b=",b,"\n"); document.write ("a=",a," and b=",b,'\n'); document.write ("a=",a," and b=",b,\n); //fail
-
May 6, 2008, 15:24 #2
- Join Date
- Jul 2007
- Posts
- 345
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Using "\n" does add a line break. To your html. However, the browser ignores whitespace when rendering the page.
To tell the browser to break to a new line, you need "<br />" or your content needs to be in a block level element.
-
May 7, 2008, 02:49 #3
Shoot I was thinking something like that as I only use \n for form processing that I can think of. Thanks though, I just wanted the cleanest script I could do
-
May 7, 2008, 03:02 #4
Bookmarks