Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    85
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Just a quick question about line break

    Hi guys, just a quick question about a line break in JavaScript, where would I do it? If you see I have two math operators here and want them to be on two separate lines, were do I put the line break?

    Thanks

    Code:
    <!doctype html>
    
    <head>
    </head>
    <body>
    
    <script type="text/javascript">
    	var apples = 4+76;
    	document.write(apples);
    	
    	var multiple = 54*11;
    	document.write(multiple);
    </script>
    
    
    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    For your example
    Code:
    document.write(apples+"<br/>");
    I am fine with "document.write" if you are a real beginner. But you should get rid off that as soon as possible and use the proper DOM manipulation methods instead


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •