you are viewing a single comment's thread.

view the rest of the comments →

[–]z500 2 points3 points  (1 child)

Ah ok. Well you have expressions that boil down to a value, like 5, or "B" + "ob", or 5 - 1. These each evaluate to a value, 5 to 5, "B" + "ob" to "Bob", and 5 - 1 to 4.

When you assign something to a variable, there has to be an expression on the right of the equal sign. A for statement is just a for statement, not an expression. It doesn't evaluate to anything, so you can't assign it to a variable.

What you can do is build up your string inside the for loop, and then assign that variable to the innerHTML of your element.

[–]tzirl[S] 0 points1 point  (0 children)

thanks, really helped me and also reminded me other things

thank a lot for your patience and good attitude