Introduction to Javascript - Javascript Introduction
Introduction to Javascript - Javascript Introduction
- JavaScript is the world's most popular programming language.
- JavaScript is the programming language of the Web.
- JavaScript is easy to learn.
Sample Code

<!DOCTYPE html>
<html>
<body>
<h2>MY javascript</h2>
<button type="button" onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.</button>
<p id="demo"></p>
</body>
</html>
Output

Javascript can change HTML element - Sample Code

<!DOCTYPE html>
<html>
<body>
<h2>What Can JavaScript Do?</h2>
<p id="demo">JavaScript can change HTML content.</p>
<button type="button" onclick='document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Click Me!</button>
</body>
</html>
Output

JavaScript accepts both double and single quotes