How can we print HelloWorld with JavaScript

HTML Javascript



A script is a small piece of program that can add interactivity to your website. For example, a script could generate a pop-up alert box message, or deliver a drop-down menu. This script could be written using Javascript or VBScript.

You can write various small functions called event handlers using one of the scripting languages ​​and then you can trigger those functions using HTML attributes.

Now is just a day Javascript and the related frameworks are used by most web developers, VBScript is not also supported by various major browsers.

You can keep Javascript code in a separate file, and then include it everywhere it's needed, or you can define functionality inside HTML document yourself. Let's see both the cases are given one by one with suitable examples.

External Javascript

If you are going to define a functionality that is used in different HTML documents then it is better to keep that functionality in a separate Javascript file and then define that file within your HTML documents. a JavaScript file is called an extension .js and it will need to be included in HTML files using