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

Javascript Introduction
<!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 Introduction

Javascript can change HTML element - Sample Code

Javascript Introduction
<!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 Introduction

JavaScript accepts both double and single quotes


Related Searches to Introduction to Javascript - Javascript Introduction