Connecting Tech Pros Worldwide Forums | Help | Site Map

leaveGap function

Newbie
 
Join Date: Mar 2006
Posts: 7
#1: Mar 10 '06
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?

Newbie
 
Join Date: Mar 2006
Posts: 7
#2: Mar 10 '06

re: 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?
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,183
#3: Mar 10 '06

re: leaveGap function


This is simple enough for you to have a go at yourself. You will need to use a loop.
Newbie
 
Join Date: Mar 2006
Posts: 3
#4: Mar 11 '06

re: leaveGap function


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