JavaScript is the world's most common programming language for the web. It’s easy to learn.
Example
This tutorial will help you to learn JavaScript from basic to advanced.
<!DOCTYPE html>
<html>
<body>
<h2>Hello world</h2>
<button type="button" onclick="document.getElementById('pr_testme').innerHTML = Date()">display Date and Time.</button>
<p id="pr_testme"></p>
</body>
</html>
Output:
Click the button and it will show you the current date and time using javascript Date object
What is javascript?
JavaScript is the language of writing or editing that allows you to use sophisticated features on web pages - every time a web page does more than just sit there and show you static content - it shows timely content updates, interactive maps, animated 2D / 3D graphics, boxes -jukebox investigating, etc. - you can trust that JavaScript may be involved. The third layer of the basic web layer technology, both (HTML and CSS) which we have covered in more detail in other parts of the Learning Area.
- HTML is a markup language that we use to organize and interpret our web content, for example, to define categories, titles, and data tables, or to embed images and videos on a page.
- CSS is the language of style rules we use to style our HTML content, for example, to set background colors and fonts, and to place our content in multiple columns.
- JavaScript is a scripting language that allows you to create dynamic content, control multimedia, animation, and much more. (Okay, not everything, but it's amazing what you can get with a few lines of JavaScript code.)