Learn JavaScript in 1 hour
Index
1. Getting started JavaScript
1. Variable and Datatype
2. Oparators
3. Control Structure
4. Data Structure (Array,JOSN)
5. Function
6. Object (Core,DOM,BOM)
7. Event Attribute and handling
Getting Started JavaScript:
step 1. Create a new HTML document name
example1.htm using notepad or dreamweaver.
step 2. Write the following code:
<html>
<head><title>First JavaScript</title>
<script>
//Javascript goes here..
</script>
</head>
<body>
<script>
//Javascript goes here..
</script>
<h2>more than one script element is allowed in a document</h2>
<script>
//Javascript goes here..
</script>
</body>
</html>
Ideally your can write JavaScript in two areas 1. In <head> element and 2. In <body> element as above. You can write as many as script element in html document. Wait don't be so hurry to produce any output. the above code will not produce any output. this is just a basic structure.
step3. Update your example1.htm document. The following code will produce an output.
<html>
<head><title>First JavaScript</title>
</head>
<body>
<script>
document.write("Hello World!");
</script>
</script>
</body>
</html>
Output
Hello world!
Comments 1