Department of Computer Science
CS1102 Introduction to Computer Studies
Lecture 05
Web Development: Javascript
Semester A, 2025-2026
JavaScript
JavaScript. is a programming language that can provide instructions for a browser to dynamically generate content for a website or enhance the website interactivity
JavaScript. can be embedded in the head or body section of the webpage, with the code defined inside the
JavaScript. Website Interactivity
Website interactivity can be enhanced by detecting a user event and defining the corresponding event handler to perform. certain action, e.g., the following program has an event handler that detects if the user clicks on the h2 heading “Click Me” and then calls the function myclick to pop up a message.
JavaScript. Dynamic Content
The innerHTML property allows the content of an HTML element to be changed dynamically