{{{{ JavaScript Examples }}}}
To look at the scripts, click on 'page' for the example you require, then when the page loads, click on
View
, then
Source
.
Simple Input and Output
Button and Alert
page
info
Textbox
page
info
Textarea
page
info
Text and Button
page
info
Select
page
info
Select with value
page
info
Radio buttons
page
info
Conditions
Simple if
page
info
if ... else
page
info
Multiple else
page
info
Compound if
page
info
Pictures
Mouse click
page
info
Change picture
page
info
Mouse point
page
info
Example - horse
page
info
Example - gallery
page
info
Gallery 2 (links)
page
Loops
Simple loop
page
info
Double loop
page
info
Conditional loop
page
info
Example - mosaic
page
info
Functions and Variables
Function
page
info
When code is actioned
page
info
Variable
page
info
Global variables
page
info
Parameter
page
info
Random numbers
page
info
Numbers and Strings
Data types
page
info
Numbers
page
info
Reverse string
page
info
Sub-strings
page
info
Sum to a single digit
page
info
Round to 2 decimal places
page
info
Pig Latin
page
info
HTML
Writing HTML
page
info
Dynamic HTML
page
info
Example-questions
page
info
Time
Timer
page
info
Time interrupt
page
info
Animation
page
info
Arrays
Single array
page
info
Example - Sort
page
info
Double array
page
info
Example - Draughts
page
info
Return to JavaScript index
All the HTML has been validated using
W3C HTNL Validator
. This means that they have some stuff at the beginning telling the validator various information. The HTML will work without this (but it won't conform to W3C recommendations).
© Jo Edkins 2005