I said I would write another basic javascript tutorial and I may go on a bit more but here it is.
Conditions like If/Else should be used if you want to make a certain condition be excecuted, for example.
CODE
<script type="text/javascript">
<!--
var name = Dan;
if (name == Dan)
{
document.write("My name is Dan")
}
//-->
</script>
So here we have defined the variable 'name' with the string 'Dan' and then we have used if (name) to tell the IF statement which variable to check whether the name is Dan. == is the operator for equal too which you will know if you did Maths in school or whatever, you can have varied responses instead of document write.
CODE
<script type="text/javascript">
<!--
var name = Dan;
if (name == Dan)
{
alert("My name is Dan")
}
//-->
</script>
This will execute it in an alert, also you can use the H1, H2 tags bold etc with the basic HTML tags, you can also add the else condition so that if the result turns back negative it can output something totally different. I have changed the variable in this one.
CODE
<script type="text/javascript">
<!--
var name = Jimbo;
if (name == Jimbo)
{
document.write("My name is Dan")
// This will return the correct result.
}
else
{
// This is where we can change it for example
alert("13Dots rocks my pretty pink socks")
}
//-->
</script>
You can go more advanced with this, but this is only a basic tutorial so perhaps another time

Operators are easy and you can find references anywhere, these are the ones I find most useful.
CODE
+ - Plus
- - Take away
== Equal to
< - Less than
> - More than
* - Multyiply
&& - And
Functions are something I use quite a bit when coding javascript, as they can be really useful but sometimes quite difficult to grasp, to use a function you must 'call' it for it too work.
CODE
<script type="text/javascript">
<!--
function alert()
{
alert("13Dots - javascript Tutorial")
}
//-->
</script>
<!-- HTML or whatever here --!>
<script type="text/javascript">
<!--
document.write("alert()");
//-->
</script>
A breakdown of this is that you can use a function to store something until you call it when someone does something or even as soon as it loads, you use the 'function' to begin it and then your functionname() then you use the brackets as normal.
CODE
function functionname()
{
// Function thingy here such as alert, document.write or whatever
}
Hope you understand this well enough as I plan on writing quite a few tutorials soon.