Jump to content

error when deleting "<br>"


hisoka
 Share

Recommended Posts

when I run this script :

 

 

var counter = 10;
while (counter > 0)
{
document.write (counter + "<br>");
counter--;
}

 

I get : 10 9 8 7 6 5 4 3 2 1

 

however when I delete "<br>" from the script above like this :

 

var counter = 10;
while (counter > 0)
{
document.write (counter + );
counter--;
}

 

an error is engendered : SyntaxError: expected expression, got ')'

 

why when I deleted "<br>" an error is engendered ?

Edited by hisoka
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...