Output – JavaScript Basics

Output can be displayed in different ways using JS. Using window.alert( ) This function is used to display a message alert. <!DOCTYPE html> <html> <body> <h1>Code Projects</h1> <p>Projects, Tutorials and More </p> <script> window.alert(“ALERT”); </script> </body> </html> Output : Using…

Where To – JavaScript Basics

<script> Tag : JavaScript code must be located between opening and closing script tags ; <script> and </script> tags. <!DOCTYPE html> <html> <body> <h1>JavaScript Basics</h1> <p id=”ex”></p> <script> document.getElementById(“ex”).innerHTML = “Hello World! This Is My First JavaScript”; </script> </body> </html> Output…