JavaScript

JavaScript provides dynamic interactivity on websites. A simple task handled easily by JavaScript is to manipulate HTML elements. We use HTML for content, CSS for presentation and JavaScript for behavior.


showhide is a method to show what was once hidden. JavaScript and the DOM are working together to toggle the display. Select the + button to see what was hidden, without reloading the pageview.

Alice and the March Hare and the Hatter.

There was a table set out under a tree in front of the house, and the March Hare and the Hatter were having tea at it: a Dormouse was sitting between them, fast asleep, and the other two were using it as a cushion, resting their elbows on it, and talking over its head. "Very uncomfortable for the Dormouse," thought Alice; "only, as it's asleep, I suppose it doesn't mind."

Alice in Wonderland

The table was a large one, but the three were all crowded together at one corner of it: "No room! No room!" they cried out when they saw Alice coming. "There's PLENTY of room!" said Alice indignantly, and she sat down in a large arm-chair at one end of the table.

"Have some wine," the March Hare said with an encouraging tone. Alice looked all round the table, but there was nothing on it but tea. "I don't see any wine," she remarked. "There isn't any," said the March Hare.


array and setInterval

what can you say about this?

JavaScript runs in your web browser alongside HTML and CSS and can be added to any web page using a script tag.
<script src="/path/scriptee.js"></script> Use an external file to save page load time and to allow the browser to cache the file locally (on the remote client's computer).

querySelector
variables

variables are containers to store values in. Use the var keyword followed by a name.

var myVar = 'Sue';
//comment one line
/*when you
really need to
tell a story
*/
innerHTML

This and that.

jQuery is a JavaScript library