What is JavaScript?
JavaScript is a web programming language that communicates with HTML elements and their values.
It can add or remove some effects to them and handle events that happen on the page.
JavaScript is a client-side language, i.e. it is executing on visitors’ computers, not on a web server.
What are the differences between Java and JavaScript?
It is better to ask what are the similarities except for the name? Java is a language that can create special objects for being inserted into a web page as an ‘Applet’ and is a more complex language than JavaScript.
JavaScript is a language inserted directly among HTML codes and no compiling or extra resources are needed to get ran. But, Java needs its package to be downloaded and installed on your computer.
Introduction (JavaScript and HTML):
Before you can start JavaScript programming, you must know HTML coding. You must create your page with one HTML editor (such as notepad) as we have said in the HTML tutorial. Tables, anchors, images, forms, paragraphs, divs, etc. are HTML elements and designed by HTML language;
Then it’s time to put your java codes to make your page more intelligent; No extra editor or component is needed. You can also let visitors edit your HTML codes with JavaScript!
JavaScript codes are usually added in the <head> part of the HTML pages. To start the JavaScript tag, follow this structure:
<!DOCTYPE html> <html> <head> <script> // Write down here JavaScript expressions </script> </head> <body> </body> </html>
Between the <script>and </script> tags is the place to put the JavaScript code.