Posts

Showing posts from December, 2025

JavaScript Coding Day 15 | JavaScript Basics: Alerts, DOM Manipulation, and Arrays

Image
JavaScript Basics: Alerts, DOM Manipulation, and Arrays Watch the lesson tutorial   🔻 Welcome back to the blog! Today, we are going to explore different ways to display output in JavaScript and how to handle basic data structures like Arrays. Whether you are running this code on a local browser or an online editor like NextLeap , these examples will help you understand the core concepts. 1. The Alert Box The simplest way to show a message to a user is using the window.alert() method. This pops up a small window on the browser screen. The user must click "OK" to proceed. Practical Example: HTML < script > // This will create a popup window with the name "Prasad" window .alert( "Prasad" ); // Output: A browser popup displaying "Prasad" </ script > 2. Changing Text Content ( innerText ) To display data directly on the web page, we often manipulate the HTML elements. The innerText property allows you to change the ...