Create your first JavaScript JavaScript


show more Get started writing JavaScript by writing your very first script. Learn how to take a basic HTML page and add a simple JavaScript statement that pops up an alert box. show less
please wait ...

Creating your first JavaScript

So let's get started with writing some JavaScript. Well, JavaScript runs in a web page. That is the container that it needs to sit in. So step one, have a web page. I have a very simple HTML file here on my Desktop. It's about as basic as they come. I can open it up in a browser here and take a look that it's really straightforward. I'm now going to open it up in a text editor, and I'm just going to use TextEdit here; the equivalent would be Notepad on a PC, but you can use anything you like. I'll just increase the text size to make that a bit more readable.

And as you can see, it's super basic. The HTML is just describing the content and structure of a simple page. We have a headline. We have a couple of paragraphs. We have an unordered list. I don't even have CSS on this page. I'm not worried whether this is HTML Strict or XHTML Transitional; we're just proving a point. Well, just as we use opening and closing h1 tags to surround a headline, or opening an...

Creating your first JavaScript
Video duration: 2m 13s 5h 31m Beginner

Viewers:

Get started writing JavaScript by writing your very first script. Learn how to take a basic HTML page and add a simple JavaScript statement that pops up an alert box.

Subjects:
Developer Web
Software:
JavaScript
Author:
please wait ...