Checkboxes
Checkboxes are used when you want the user to select one or more options of a limited number of choices.
How it looks in a browser:
html checkbox form
???? Computer
html radio form
Radio Buttons
Radio Buttons are used when you want the user to select one of a limited number of choices.
How it looks in a browser:
???? Computer
never ending loop
JavaScript for Loops
The for loop is used when you know in advance how many times the script should run.
Syntax
| for (var=startvalue;var<=endvalue;var=var+increment) { code to be executed } |
Example
var i=0;
for (i=0;i<=5;i++)
{
document.write("The number is " + i);
document.write("
");
}
The example below defines a loop that starts with i=0. The loop will continue to run as long as i is less than, or equal to 5. i will increase by 1 each time the loop runs.Note: The increment parameter could also be negative, and the <= could be any comparing statement.
Example
If you want a never ending loops, you just decrease your variable.
var i=0;
for (i=0;i<=5;i--)
{
document.write("The number is " + i);
document.write("
");
}
Read More..
???? Computer
Subscribe to:
Postingan (Atom)