JavaScript Explained: The Behaviour Behind Interactive Websites
What makes a website react when you click? JavaScript can add behaviour and update page content.
1:47 · No narration: the video shows each step as text on screen, and every step is written out below, with buttons that jump the video to it.
Prefer YouTube? Watch this video on our YouTube channel (opens in a new tab).
The six points in the video
This is a silent video. The headings, explanations and labels below reproduce the information on screen.
-
Step 1: It is a programming language
JavaScript can run instructions in the browser.
On-screen labels: Program logic; Browser execution; Interactive behaviour.
-
Step 2: It responds to events
A click, key press or submitted form can trigger an action.
On-screen labels: Click or tap; Keyboard action; Form submission.
-
Step 3: It can update the page
Useful changes can happen without a full page reload.
On-screen labels: Updated results; Visible feedback; Changed content.
-
Step 4: It can contact services
A page can request data and display the response.
On-screen labels: Service request; Returned data; Updated interface.
-
Step 5: Keep interactions accessible
Keyboard operation and clear feedback still need attention.
On-screen labels: Keyboard access; Visible status; Useful error messages.
-
Step 6: Test failure as well as success
Important tasks need sensible handling when something goes wrong.
On-screen labels: Slow response; Failed request; Recoverable next step.
A practical check for your business
Identify which tasks depend on JavaScript and test their failure states. A form, menu or booking widget should provide a useful result or explanation when its expected script cannot complete the task.
Sources and further detail
Common questions
What makes a website react when you click?
JavaScript can add behaviour and update page content. Make every interaction serve a useful task.
Go further
More video tips
All 205 videos →
Frontend vs Backend: Which Part of a Website Does What?
Frontend and backend, explained.
Website Databases Explained: Content, Records and Recovery
Website databases, explained.