Web Development - HTML, CSS & JavaScript
55.4K subscribers
1.93K photos
5 videos
34 files
545 links
Learn to code and become a Web Developer with HTML, CSS, JavaScript , Reactjs, Wordpress, PHP, Mern & Nodejs knowledge

Managed by: @love_data
Download Telegram
โŒจ๏ธ JavaScript Neat Tricks you should know
โค5
๐—ง๐—ข๐—ฃ ๐Ÿฏ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—˜๐—ฅ๐—ง๐—œ๐—™๐—œ๐—–๐—”๐—ง๐—œ๐—ข๐—ก๐—ฆ ๐—œ๐—ก ๐——๐—”๐—ง๐—” ๐—ฆ๐—–๐—œ๐—˜๐—ก๐—–๐—˜ & ๐—”๐—ก๐—”๐—Ÿ๐—ฌ๐—ง๐—œ๐—–๐—ฆ! ๐Ÿ“Š

Kick-start your career in Data Science or Data Analytics

โœ… Build In-Demand Technical Skills
โœ… Strengthen Your Resume
โœ… Explore Certification Opportunities

๐ŸŽฏ Perfect for Students, Freshers & Aspiring Data Analysts!

๐—Ÿ๐—ถ๐—ป๐—ธ๐Ÿ‘‡:-

https://pdlink.in/4g3OYGL

๐Ÿ“Œ SAVE & SHARE with your friends! ๐Ÿ”ฅ
๐ŸŸจ JAVASCRIPT LEARNING SERIES: DAY 10

๐ŸŒ DOM Manipulation in JavaScript

DOM stands for Document Object Model.

It allows JavaScript to interact with HTML elements and dynamically change the content, structure, and styling of a webpage.

For example, JavaScript can:

โ€ข Change heading text.

โ€ข Change colors and styles.

โ€ข Add or remove HTML elements.

โ€ข Respond to button clicks.

โ€ข Validate form inputs.

โ€ข Make webpages interactive.

Let's understand it step by step.

1๏ธโƒฃ What is the DOM?

When a browser loads an HTML page, it creates a tree-like structure of elements called the DOM.

Example HTML:

<!DOCTYPE html>
<html>
<body>
<h1>Hello World</h1>
<p>Welcome to JavaScript</p>
</body>
</html>


JavaScript can access and modify these elements through the DOM.

2๏ธโƒฃ Selecting HTML Elements

Before changing an element, we need to select it.

getElementById()

Selects an element using its ID.

<h1 id="title">Hello World</h1>


let heading = document.getElementById("title");

console.log(heading);


querySelector()

Selects the first element matching a CSS selector.

let heading = document.querySelector("#title");
let paragraph = document.querySelector(".description");


querySelectorAll()

Selects all elements matching a CSS selector.

let items = document.querySelectorAll("p");

console.log(items);


Other selection methods:

โ€ข getElementsByClassName(), Selects elements by class name.

โ€ข getElementsByTagName(), Selects elements by tag name.

3๏ธโƒฃ Changing Text Content

JavaScript allows us to change the text inside HTML elements.

<h1 id="heading">Old Heading</h1>


let heading = document.getElementById("heading");

heading.textContent = "Welcome to JavaScript!";


The heading will now display:

Welcome to JavaScript!

textContent vs innerHTML

โ€ข textContent changes or retrieves text.

โ€ข innerHTML reads or changes HTML markup inside an element.

Example:

document.getElementById("heading").innerHTML =
"<span>Hello JavaScript</span>";


Use innerHTML carefully with untrusted input because inserting unsafe HTML can create security vulnerabilities.

4๏ธโƒฃ Changing CSS Styles

You can dynamically change the styling of an element.

<p id="message">Hello World</p>


let message = document.getElementById("message");

message.style.color = "blue";
message.style.fontSize = "24px";
message.style.backgroundColor = "lightyellow";


The paragraph's appearance will change instantly.

5๏ธโƒฃ Adding and Removing CSS Classes

Instead of changing individual styles, you can use classList.

add()

element.classList.add("active");


remove()

element.classList.remove("active");


toggle()

Adds a class if it doesn't exist and removes it if it does.

element.classList.toggle("active");


contains()

Checks whether an element has a particular class.

console.log(element.classList.contains("active"));
6๏ธโƒฃ Handling Events

Events allow JavaScript to respond to user actions.

Common events include:

โ€ข click, When an element is clicked.

โ€ข mouseover, When the pointer moves over an element.

โ€ข mouseout, When the pointer leaves an element.

โ€ข keydown, When a keyboard key is pressed.

โ€ข submit, When a form is submitted.

โ€ข change, When an input value changes.

<button id="btn">Click Me</button>


let button = document.getElementById("btn");

button.addEventListener("click", function() {
console.log("Button Clicked!");
});


Whenever the user clicks the button, the message appears in the console.

7๏ธโƒฃ Creating New HTML Elements

JavaScript can create HTML elements dynamically.

let paragraph = document.createElement("p");

paragraph.textContent = "This is a new paragraph.";

document.body.appendChild(paragraph);


Here:

โ€ข createElement() creates a new element.

โ€ข textContent adds its text.

โ€ข appendChild() inserts it into the page.

8๏ธโƒฃ Removing HTML Elements

You can remove elements using remove().

<p id="text">Remove this paragraph</p>


let paragraph = document.getElementById("text");

paragraph.remove();


The paragraph will be removed from the webpage.

9๏ธโƒฃ Working with Input Fields

JavaScript can read values entered by users.

<input type="text" id="username" placeholder="Enter your name">

<button id="submit">Submit</button>


let button = document.getElementById("submit");

button.addEventListener("click", function() {
let name = document.getElementById("username").value;

console.log("Welcome " + name);
});


The .value property retrieves the current value of an input field.

๐Ÿ”Ÿ DOM Traversal

DOM traversal means moving between related HTML elements.

Some useful properties:

โ€ข parentElement, Gets the parent element.

โ€ข children, Gets the child elements.

โ€ข firstElementChild, Gets the first child element.

โ€ข lastElementChild, Gets the last child element.

โ€ข nextElementSibling, Gets the next sibling.

โ€ข previousElementSibling, Gets the previous sibling.

<div id="parent">
<p>First</p>
<p>Second</p>
</div>


let parent = document.getElementById("parent");

console.log(parent.children);
console.log(parent.firstElementChild);


1๏ธโƒฃ1๏ธโƒฃ Event Object

When an event occurs, JavaScript provides an event object containing information about that event.

button.addEventListener("click", function(event) {
console.log(event.type);
console.log(event.target);
});


Output:

click
<button id="btn">Click Me</button>


Some useful event properties:

โ€ข event.type, Type of event.

โ€ข event.target, Element that triggered the event.

โ€ข event.preventDefault(), Prevents the browser's default action.

1๏ธโƒฃ2๏ธโƒฃ Event Bubbling

Event bubbling means an event triggered on a child element can propagate upward to its parent elements.

For example:

<div id="parent">
<button id="child">Click Me</button>
</div>
document.getElementById("parent")
.addEventListener("click", function() {
console.log("Parent Clicked");
});

document.getElementById("child")
.addEventListener("click", function() {
console.log("Child Clicked");
});


Clicking the button produces:

Child Clicked
Parent Clicked


This happens because the event bubbles from the child to the parent.

๐Ÿ’ป Real-World Example: Interactive Counter

Let's create a simple counter using DOM manipulation.

<h2 id="count">0</h2>

<button id="increase">Increase</button>
<button id="decrease">Decrease</button>


```javascript
let count = 0;

let display = document.getElementById("count");

document.getElementById("increase")
.addEventListener("click", function() {
count++;
display.textContent = count;
});

document.getElementById("decrease")
.addEventListener("click", function() {
count--;
display.textContent = count;
});`


This example demonstrates how JavaScript updates webpage content based on user interaction.

โšก Quick Revision

โ€ข document โ†’ Represents the webpage.

โ€ข getElementById() โ†’ Selects an element by ID.

โ€ข querySelector() โ†’ Selects the first matching element.

โ€ข querySelectorAll() โ†’ Selects all matching elements.

โ€ข textContent โ†’ Changes or retrieves text.

โ€ข innerHTML โ†’ Changes or retrieves HTML markup.

โ€ข style โ†’ Changes CSS styles.

โ€ข classList โ†’ Manages CSS classes.

โ€ข addEventListener() โ†’ Attaches an event handler.

โ€ข createElement() โ†’ Creates an HTML element.

โ€ข appendChild() โ†’ Adds an element.

โ€ข remove() โ†’ Removes an element.

โ€ข .value โ†’ Gets an input's value.

โ€ข parentElement โ†’ Gets the parent element.

๐Ÿ’ก Key Takeaways

โ€ข DOM connects JavaScript with HTML.

โ€ข JavaScript can dynamically modify webpage content and styling.

โ€ข Events make webpages interactive.

โ€ข DOM manipulation is essential for frontend development.

โ€ข Understanding the DOM is a foundation for learning frameworks like React.

๐Ÿ“Œ Double Tap โค๏ธ For More
โค7
๐Ÿฏ ๐—™๐—ฟ๐—ฒ๐—ฒ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜๐—ผ ๐—Ÿ๐—ฒ๐˜ƒ๐—ฒ๐—น ๐—จ๐—ฝ ๐—ฌ๐—ผ๐˜‚๐—ฟ ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น๐˜€ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿณ๐Ÿ˜

Want to upgrade your technical skills without spending โ‚น1?

โœ… Learn In-Demand Tech Skills
โœ… Strengthen Your Resume
โœ… Boost Your Career Prospects

๐ŸŽฏ Perfect for Students, Freshers & Working Professionals!

๐—Ÿ๐—ถ๐—ป๐—ธ๐Ÿ‘‡:-

https://pdlink.in/4jsqp7k

๐Ÿ“Œ SAVE & SHARE with your friends! ๐Ÿ”ฅ
โค2
๐Ÿš€ ๐—ง๐—ผ๐—ฝ ๐—œ๐—ป-๐——๐—ฒ๐—บ๐—ฎ๐—ป๐—ฑ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐˜๐—ผ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ

Explore these certification courses in todayโ€™s most in-demand technology fields:

๐Ÿ’ป Full Stack :- https://pdlink.in/3SuUeuD

๐Ÿ“Š Data Analytics :- https://pdlink.in/45vk5ph

๐Ÿ’ซAI Engineering :- https://pdlink.in/4fWJVID

๐Ÿ”ฅ Take the first step towards your high-paying tech career in 2026!
๐ŸŽฏ Web Developer Projects & Interview Preparation ๐Ÿ’ผ๐Ÿ”ฅ

Now itโ€™s time to turn your skills into:

โœ… Real projects

โœ… Portfolio

โœ… Job opportunities ๐Ÿš€

This final stage is where beginners become developers ๐Ÿ’ป๐Ÿ”ฅ

๐Ÿง  1. Build Real Projects (Most Important)

๐ŸŸข Beginner Projects

โ€ข Calculator

โ€ข Todo App

โ€ข Weather App

โ€ข Quiz App

๐Ÿ‘‰ Focus on:

โ€ข HTML

โ€ข CSS

โ€ข JavaScript

๐ŸŸก Intermediate Projects

โ€ข Blog Website

โ€ข Expense Tracker

โ€ข Movie App (API based)

โ€ข Notes App

๐Ÿ‘‰ Focus on:

โ€ข APIs

โ€ข React

โ€ข State management

๐Ÿ”ด Advanced Projects

โ€ข E-commerce Website

โ€ข Chat Application

โ€ข Admin Dashboard

โ€ข Full Authentication System

๐Ÿ‘‰ Focus on:

โ€ข MERN Stack

โ€ข JWT

โ€ข Database integration

๐ŸŒ 2. Create Portfolio Website

Your portfolio should include:

โœ… About Me

โœ… Skills

โœ… Projects

โœ… GitHub link

โœ… Contact form

๐Ÿ’ก Recruiters often judge developers by portfolio first ๐Ÿ‘€

๐Ÿ”ฅ 3. Upload Everything to GitHub

๐Ÿ‘‰ Push all projects to: GitHub

๐Ÿ’ก Add:

โ€ข README

โ€ข Screenshots

โ€ข Live demo links

๐Ÿง  4. Interview Preparation

Most Asked Topics ๐Ÿ”ฅ

โ€ข HTML semantic tags

โ€ข CSS Flexbox/Grid

โ€ข JavaScript closures

โ€ข Promises & Async/Await

โ€ข React hooks

โ€ข APIs

โ€ข Authentication

โ€ข SQL basics

โšก 5. Practice Coding Questions

Practice on:

โ€ข LeetCode

โ€ข HackerRank

โ€ข Codewars

๐Ÿ’ผ 6. Resume Tips

โœ… Add:

โ€ข Skills

โ€ข Projects

โ€ข GitHub

โ€ข Deployment links

โŒ Avoid:

โ€ข Fake experience

โ€ข Too much theory

โ€ข Unnecessary personal info

๐Ÿš€ 7. Job Strategy

Apply for:

โ€ข Frontend Developer

โ€ข React Developer

โ€ข Full Stack Developer

โ€ข Web Developer Internships

๐ŸŽฏ 8. Final Learning Strategy

Learn โ†’ Build โ†’ Deploy โ†’ Upload โ†’ Repeat

๐Ÿ‘‰ This cycle is the real roadmap ๐Ÿ”ฅ

๐Ÿ’ก Golden Advice

โŒ Donโ€™t become tutorial addicted

โœ… Build projects independently

โŒ Donโ€™t focus only on certificates

โœ… Focus on skills + portfolio

Tap โค๏ธ For More
โค4
๐Ÿš€ ๐Ÿฏ ๐—™๐—ฅ๐—˜๐—˜ ๐—š๐—˜๐—ก๐—˜๐—ฅ๐—”๐—ง๐—œ๐—ฉ๐—˜ ๐—”๐—œ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—™๐—ข๐—ฅ ๐——๐—”๐—ง๐—” ๐—”๐—ก๐—”๐—Ÿ๐—ฌ๐—ง๐—œ๐—–๐—ฆ! ๐Ÿ“Š

Want to upgrade your Data Analytics skills with Generative AI for FREE?

โœ… Explore Generative AI
โœ… Build In-Demand AI Skills
โœ… Strengthen Your Resume
โœ… Boost Your Career Prospects

๐ŸŽฏ Perfect for Students, Freshers & Aspiring Data Analysts!

๐—Ÿ๐—ถ๐—ป๐—ธ๐Ÿ‘‡:-

https://pdlink.in/4jlu9c1

๐Ÿ“Œ SAVE & SHARE with your friends! ๐Ÿ”ฅ
๐——๐—ฒ๐˜ƒ๐—ข๐—ฝ๐˜€ ๐—™๐—ฅ๐—˜๐—˜ ๐—ข๐—ป๐—น๐—ถ๐—ป๐—ฒ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ๐—ฐ๐—น๐—ฎ๐˜€๐˜€ ๐Ÿ˜

Learn โ†’ Build โ†’ Deploy

- Discover how AI automates DevOps with faster testing, smarter deployments, and intelligent monitoring.
โ€‹
Eligibility :- College Students ,Freshers & Working Professionals
โ€‹
๐—ฅ๐—ฒ๐—ด๐—ถ๐˜€๐˜๐—ฒ๐—ฟ ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡ :-

https://pdlink.in/4A5jnf4 ( Only Limited Slots )

Date:- 05th December, 2026 Time:- 7:00 PM (IST)
๐Ÿฑ ๐—ฃ๐—ข๐—ช๐—˜๐—ฅ๐—™๐—จ๐—Ÿ ๐—™๐—ฅ๐—˜๐—˜ ๐—”๐—œ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—™๐—ฅ๐—ข๐—  ๐—›๐—”๐—ฅ๐—ฉ๐—”๐—ฅ๐—— & ๐—ฆ๐—ง๐—”๐—ก๐—™๐—ข๐—ฅ๐——๐ŸŽ“

Learn Artificial Intelligence with free educational resources from two of the world's leading universities!

โœ… Build Your AI Knowledge
โœ… Upgrade Your Technical Skills
โœ… Strengthen Your Resume
โœ… Learn at Your Own Pace

๐ŸŽฏ Perfect for Students, Freshers & Tech Professionals!

๐—Ÿ๐—ถ๐—ป๐—ธ๐Ÿ‘‡:-

https://pdlink.in/49C6C0J

๐Ÿ“Œ SAVE & SHARE with your friends! ๐Ÿ”ฅ