-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Fangorn
-
-
Thanks niche,
so I suppose is always fundamental to define a variable as a string or as a number (var number = 0 or var text="").
I still have to understand how the loop works and the importance of the variable 'text' for the code itself.
I tried to delete the '+' from the code, and use text = ... instead of: text += "The number is " + i + "<br>";
and the result is only the last line, 'The number is 4'.
So I do not understand what text = text + "The number is " + i + "<br>"; means inside the loop, if one should explain it in words.
Taken for granted that understand "The number is " + i + "<br>", I suppose is just the code text = text + ... that prints out all the results of the loop. What happens there?
For instance, for i=0 we should have: text = text + The number is 0...
So what does 'text' represent?
I am sorry if the question looks so banal, but I am really stuck in this loop
-
Hi,
I just started to study javascript and I came across in one of your page to the following notation:
var text="";
The page is from w3school tutorial: http://www.w3schools.com/js/tryit.asp?filename=tryjs_loop_for_ex
I do not understand what it means and why should be used in the loop of the above example.
I tried to define var text; in its place but the result is:
undefinedThe number is 0The number is 1The number is 2The number is 3The number is 4
The only difference is the world 'undefined' at the beginning of the first line.
Many thanks in advance for your help
-
Hi everybody,
I was able with some research to find documentation on tabbed navigation.
I gathered all the information I found, and decided to make a code entirely with css and css3.
The look is nice, however I am unable to control the height of the tabs.
I set a value in the class .tablist inside the css sheet, but the height does not increase if I change this value. Moreover it seems it depends on the font-size and on the padding value in .tablist li a.
I attached four html pages (page1.html ... page4.html):
and the css sheet:
Does any of any idea of how can I take control over the height of the tabs?
Many thanks in advance
var text="";
in JavaScript
Posted
Got it!!!
Therefore, using the code above, it will be:
for i = 0: text = "The number is 0" + <br>
for i = 1: text = text + "The number is 1" that is: text = "The number is 0" + <br> + "The number is 1" + <br>
for i = 2: text = text + "The number is 2" that is: text ="The number is 0" + <br> + "The number is 1" + <br> + "the number is 2" + <br>
... etc ...
Thank you very much!!! :)