With Javascript, you can functionality on your webpage. You can use it to validate form, file upload using AJAX, submit a form, etc.
You can add JavaScript code using an external .js file or directly specify code between <script >
tags on the page.
In this tutorial, I show both ways to include Javascript code on the page.