Javascript Introduction

HTML to define the content of web pages,
CSS to specify the layout of web pages and finally,
JavaScript to program the behavior of web pages

Scripts

JavaScript must be written inside the <script> tag in HTML. Scripts can be placed in either the <head>, <body> or both if need be. Scripts can also be placed in an external file and it’s more practical to use this method when many HTML documents make use of the same JavaScript.
JavaScript files have the extension .js

JavaScript Methods

getElementById();

JavaScript Output

  • innerHTML
  • document.write()
  • window.alert()
  • console.log

Leave a comment

Create your own website, free on WordPress.com.Create your own website.
Start free