JavaScript is a computer programming language. The most common use of JavaScript is as code embedded in HTML (web) pages.
Unlike PHP and other server side languages JavaScript code can run locally in your browser. This means you can learn and practice writing Javascript code on just about any computer whether or not it is connected to the internet. You don't need to buy any software and you don't have to set up a local file server. All you need is a text editor and a browser.
JavaScript Example
If you copy the text below into a text editor and then save it as "anything.html" and then double click on the file you've saved it should open up your web browser and display the numbers 1 to 10 separated by commas. It is that easy to create a web page containing JavaScript!
<!DOCTYPE html>
<meta charset="utf-8">
<title>JavaScript Example</title><span id="text"></span>
<script>
var j;
var output;output="";
for(j=1;j<11;j++)
{
output=output+j+", ";
}document.getElementById ("text").innerHTML=output;
</script>
Local Government & Municipal Knowledge Base
Many of the HTML snippets embedded in pages throughout this site contain JavaScript.
Related Pages
Contributors
The following site members have contributed to this page: