Stay tuned for additional content in this series.
Editorial note: This series has been updated with interactive code capabilities. When you see Run on a code listing, it means you can run the code, check the results, make modifications, and run it again.
In each section there are exercises and a quiz so you can practice as you learn. The best part is, there’s no setup for you. You’ll interact directly on this web page. You don’t even have to worry about opening another tab or window; you can do it all right here, in the sandboxes like the one below.
Your turn! Try changing the code
World is always a good place to start. Click Run to see
console.log function write the data to this page. You can
change the words, change the code, then click Run again
and see what happens.
- Dynamically add, edit, and remove HTML elements and their values
- Validate web forms before submission
- Create cookies to store and retrieve data on a user's computer for future visits
Before getting started, there are just a few language basics to be aware of:
inside script tags and include the
- The language is case sensitive.
- All variable names must begin with a letter or underscore.
- You can use comments to identify certain lines of your script. You write comments using a double forward slash (//) followed by the comment.
- You can also use comments to comment out script. A good way to comment
out multiple lines of script is by using
/* your script goes here */. Any script within the stars
/**/doesn't run during execution.
attribute in the script tag. Here's what to type:
- Search engines can crawl and index your web site faster if there is less code within your HTML page.
Summary and next steps
- Java development hub on developerWorks
- Intro to Java Programming learning path
- More tutorials for Java developers