Open your Html file, we have a simple Html web page with a single button.
When we open this HTML file in the browser, we see the button with the text click me.
We defined an event for the button when the button is clicked it will invoke the function that we defined in between the script tags. The function causes an alert popup with the provided text to appear on the screen whenever the button is placed.
We created a new file jscode.js and copied the function in it.
We then changed the script tag, removed the code inside it and inserted the src attribute.