Frontend & Design · Beginner
JavaScript
The programming language that makes a web page move, click and respond. Almost every action you take on a page is answered in real time by it.
TL;DRIn 30 seconds
- The language that makes a page move, click and answer you instantly.
- You press a button, open a menu, watch a carousel — it's doing the work in real time.
- It owns behaviour and interaction only; how the page looks and what it says are someone else's job.
OverviewIn detail
JavaScript, usually shortened to JS, is where a web page's behaviour comes from. Liking something, opening a menu, watching an image carousel, seeing the 'saved' notice appear — it's JS reacting in real time behind all of it. It's one of the most widely used programming languages there is.
The earliest web pages could only be read, not used. JavaScript let a page answer the user immediately, and every browser supports it natively with nothing to install. Today it runs on servers too: with Node.js, one language carries from front end through to backend, so a single person can build a whole site.
Ask an AI for a button that changes colour on hover, or one that pops up a message when clicked, and what it gives you is most likely JavaScript. If what you want to change is how it reacts when clicked, JS is what you touch; changing the look or the wording belongs to CSS and HTML respectively.
JavaScript and Java are two unrelated languages. The similar names came from a bit of bandwagon-jumping at the time, and beginners trip over it constantly.
Nor is it the whole of a web page: structure belongs to HTML, styling to CSS, and only behaviour to JavaScript. Telling the three apart lets you describe what you want to an AI more precisely, and makes it less likely you'll damage something else while changing it.
When you're starting out there's no rush to memorise syntax — understanding what it's doing is more useful. Anything on a page that changes or responds to you is very likely its work. Working with an AI, describing the effect you want clearly is more practical than agonising over exactly how the code should be written.
MythsCommon misunderstandings
- ✕Thinking everything on a page is its doing ✓How it looks belongs to styling and what it says belongs to markup — JS handles only the parts that change
- ✕Thinking it's related to Java ✓The two only share a similar name; learning either has nothing to do with the other
- ✕Thinking you can't make a web page without it ✓Most of the time you're asking for changes to something already built, not writing from scratch
In practiceWhere you will meet it
- Wanting a button that changes colour on hover and pops a message when clicked
- Filling in a field wrongly and seeing a red warning at once — that's it responding
- Seeing code full of dots and brackets, which is usually it handling clicks and changes
SummaryThe key points
- The main character of web interaction, natively supported by every browser
- Handles real-time responses such as clicks, animation and pop-ups
- Its name says Java, but it has nothing to do with Java
FAQ
What does JavaScript mean?
The language that makes a page move, click and answer you instantly.You press a button, open a menu, watch a carousel — it's doing the work in real time.It owns behaviour and interaction only; how the page looks and what it says are someone else's job.
Where will I run into JavaScript?
Wanting a button that changes colour on hover and pops a message when clicked;Filling in a field wrongly and seeing a red warning at once — that's it responding;Seeing code full of dots and brackets, which is usually it handling clicks and changes。
What do people most often get wrong about JavaScript?
Thinking everything on a page is its doing — but How it looks belongs to styling and what it says belongs to markup — JS handles only the parts that change;Thinking it's related to Java — but The two only share a similar name; learning either has nothing to do with the other。
What are the key points about JavaScript?
The main character of web interaction, natively supported by every browser;Handles real-time responses such as clicks, animation and pop-ups;Its name says Java, but it has nothing to do with Java。
Common pitfalls JavaScript and Java are two unrelated languages — the similar names are a historical accident.
Entry 92 of 186 · All entries
Keep readingRelated reading
UI(用户界面)
用户界面,指屏幕上你能看到、点到的一切:按钮、图标、配色和排版。它解决的是好不好看、点起来顺不顺手的问题。
UX(用户体验)
用户体验,指用一款产品从头到尾的顺畅程度:找得到、看得懂、操作顺。它管的不是好不好看,而是用起来顺不顺、累不累。
视觉设计(Visual Design)
指决定页面好不好看的那一层:配色、字体、图像和版式由它定。它还要用视觉手段替用户排出先看什么、后看什么。
HTML(超文本标记语言)
网页的骨架,用标签标明哪是标题、哪是图片、哪是链接。所有网页都靠它搭出基本结构。
动效(Motion Design)
指界面里让元素动起来的细节:按钮弹一下、页面滑进来。它用来给操作即时反馈,让用户知道发生了什么。
SEO(搜索引擎优化)
搜索引擎优化,指通过调整内容和网页结构,让页面在搜索结果里排得更靠前、更容易被点开。
Where to go nextExplore more
Back to the skills themselves
Most of the concepts covered here come from skills that install into your AI client with a single command.