leaveGap function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lisaj
    New Member
    • Mar 2006
    • 8

    #1

    leaveGap function

    I need to write Javascript for the following:

    I need to seperate successive lines of input.
    Instead of using document.write( '<BR><BR><BR>' ) I need to create a leaveGap function. eg leaveGap(2)

    The function needs to be able to leave different line spaces throughout the programme eg 2 lines at one point in the programme and 1 line at another.

    Any Ideas?
  • lisaj
    New Member
    • Mar 2006
    • 8

    #2
    leaveGap function

    I have to write Javascript for the following:

    I need to seperate successive lines of input.
    Instead of using document.write( '<BR><BR><BR>' ) I need to create a leaveGap function. eg leaveGap(2)

    The function needs to be able to leave different line spaces throughout the programme eg 2 lines at one point in the programme and 1 line at another.

    Any ideas?

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      This is simple enough for you to have a go at yourself. You will need to use a loop.

      Comment

      • zagarat
        New Member
        • Mar 2006
        • 3

        #4
        function leaveGap(Lines) {
        for(i = 0; i < Lines; i++){
        document.write( '<BR>')
        }
        }

        Comment

        Working...