1. JavaScript can be used to add interactivity and dynamic behavior to web pages. It runs in the browser and can change HTML content, control the browser, and respond to events like user clicks or form submissions.
2. The Document Object Model (DOM) provides methods for accessing and modifying HTML elements on the page from JavaScript. Elements can be referenced by ID or name and then manipulated.
3. Form validation is often done with JavaScript by attaching a validation function to the form's onsubmit event handler. If validation fails, the function returns false to prevent submission.