Simulating Friend Request Delay using JavaScript (SetTimeout & DOM): I’m excited to share another small project I built while practicing JavaScript DOM manipulation and asynchronous behavior. In this project, when the “Add Friend” button is clicked, the request is not accepted instantly. Instead, it waits for 5 seconds (5000ms) before updating the status from “Stranger” to “Friend.” Similarly, when “Remove Friend” is clicked, it again takes 5 seconds before updating the status back from “Friend” to “Stranger.” This small interaction simulates how real-world applications process requests with delays, such as sending friend requests or processing server responses. Key concepts I practiced in this project: 1.) DOM Manipulation – Dynamically updating text, button labels, and styles 2.) Event Handling – Triggering UI changes using button click events 3.) SetTimeout() – Introducing a delay before executing an action 4.) UI State Management – Maintaining consistent UI changes during interactions Through this project, I clearly understood how SetTimeout() works in JavaScript and also strengthened my knowledge of DOM manipulation and interactive UI behavior. Building small projects like this helps me improve my problem-solving skills and JavaScript fundamentals step by step. Feedbacks and suggestions are always welocme! #JavaScript #DOMManipulation #SetTimeout #FrontendDevelopment #WebDevelopment #JavaScriptProjects #CodingJourney #LearningByDoing #BeginnerDeveloper #WebInteraction
More Relevant Posts
-
Download Button Simulation using JavaScript (SetInterval & DOM): I recently built a small project to practice JavaScript DOM manipulation and timing functions. In this project, I created a Download button that simulates a download process using setInterval(). When the button is clicked, the download process starts and the interface updates step-by-step until the download is completed. This project helped me understand how JavaScript can execute actions repeatedly after a fixed time interval, which is useful for things like progress indicators, timers, and real-time UI updates. Concepts I practiced in this project: 1.) DOM Manipulation – Dynamically updating elements on the webpage. 2.) Event Handling – Triggering actions through button clicks. 3.) SetInterval() – Running a function repeatedly after a specified interval. 4.) Dynamic UI Updates – Simulating a download progress experience. Through this project, I gained a clear understanding of how setInterval() works and further strengthened my DOM manipulation skills while building interactive UI behavior. Continuing to learn JavaScript by building small projects every day. Checkout my project code on GITHUB: https://lnkd.in/gZDcHde5 Feedback and Suggestions are always Welcome! #JavaScript #DOMManipulation #setInterval #FrontendDevelopment #WebDevelopment #JavaScriptProjects #CodingJourney #LearningByDoing #BeginnerDeveloper #WebInteraction
To view or add a comment, sign in
-
Day 3 of 30 Days of JavaScript........#Javascript30 Today I built an Interactive CSS Variables Controller 🎛️ This helped me understand how JavaScript can directly interact with CSS in real-time. By using input sliders, I was able to dynamically update: • Image spacing 📏 • Blur effect 🌫️ • Base color 🎨 💡 What I learned today: - Working with dataset for dynamic values. - How small mistakes in template literals can completely break functionality. - Understanding the :root selector and how it acts like a global storage for CSS variables. - Realizing how CSS variables (--variable) are similar to variables in programming and can be reused across the UI. This was a simple project, but it gave me a deeper understanding of how JavaScript + CSS work together to create interactive UI. Looking forward to building more and improving step by step 💻🔥 #JavaScript #WebDevelopment #FrontendDevelopment #Javascript30
To view or add a comment, sign in
-
🚀 Learning in Public – JavaScript DOM Today in class we explored the Document Object Model (DOM) in JavaScript. The DOM represents an HTML document as a tree structure where each element becomes an object that JavaScript can interact with. Through DOM manipulation we can make web pages dynamic and interactive. 💡 Things I learned today: • How to select elements using "document.getElementById()" "document.querySelector()" • How to modify content using "innerHTML" and "textContent" • How to change styles dynamically with JavaScript • Handling user actions using "addEventListener()" Example: document.querySelector("button").addEventListener("click", () => { document.getElementById("title").textContent = "Button Clicked!"; }); This simple concept is the foundation behind many interactive web features like forms, to-do lists, and dynamic UI updates. Small steps every day toward becoming a better developer. 💻 thanks Suraj Kumar Jha for the amazing lecture #LearnInPublic #JavaScript #WebDevelopment #DOM #chaicode
To view or add a comment, sign in
-
-
Day 14/21 : JavaScript DOM (Document Object Model) As part of my 21-Day Full Stack Revision Challenge, today I revised the DOM, which allows JavaScript to interact with and modify web pages. The DOM represents the webpage as a structured tree, making it possible to access and update elements dynamically. > Topics I Covered What is DOM – A representation of the HTML document Selecting Elements – Accessing elements using JavaScript Manipulating Content – Changing text, styles, and attributes Event Handling – Responding to user actions like clicks and inputs > Why It Matters DOM manipulation helps in creating interactive and dynamic web applications instead of static pages. Day 14 completed #FullStackDeveloper #JavaScript #DOM #WebDevelopment #LearningInPublic #21DaysChallenge #CodingJourney
To view or add a comment, sign in
-
🚀 Web Development Journey - JavaScript Day 11 Today I focused on something really practical — manipulating element styles with JavaScript. This is where you move from just selecting elements… to actually controlling how they look and behave. Here’s what I worked on: 🔹 Changing styles directly using the style property 🔹 Using cssText to apply multiple styles at once 🔹 Understanding styles better with getComputedStyle() 🔹 Working with className 🔹 And using classList (add, remove, toggle, replace) Honestly, this part made things feel more real, like I’m actually building interactive UI, not just writing code. Didn’t do anything crazy today, but I showed up and made progress. That’s what matters. Next up: JavaScript Events ⚡ #WebDevelopment #JavaScript #100DaysOfCode #FrontendDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Mastering Event Propagation in JavaScript One concept that truly leveled up my frontend debugging skills is Event Propagation. After going deep through multiple resources, medium articles, and most importantly — hands-on practice — I can confidently say: 👉 Understanding this concept separates average developers from strong problem solvers. Let me break it down simply: 🔹 Event Propagation = How events travel in the DOM There are 3 phases: 1️⃣ Capturing Phase (Top → Down) 2️⃣ Target Phase (Element itself) 3️⃣ Bubbling Phase (Bottom → Up) Most of us unknowingly work with event bubbling daily. 💡 Example: parent.addEventListener("click", () => console.log("Parent")); child.addEventListener("click", () => console.log("Child")); Clicking the child logs: Child Parent 👉 Why? Because of bubbling 🔥 Real Interview + Practical Insights: ✔️ How to stop propagation? event.stopPropagation(); ✔️ When to use capturing? addEventListener("click", handler, true); ✔️ Difference between: stopPropagation() stopImmediatePropagation() ✔️ Event delegation (used in dynamic lists, tables, large apps) ⚡ Real-world use cases I’ve handled: Fixing unwanted parent clicks in nested components Optimizing performance using event delegation Debugging complex UI interactions in large React apps 💬 My takeaway after mastering this: Understanding how events flow makes debugging 10x faster and your code more predictable. If you're preparing for frontend interviews: 👉 Don’t just memorize — visualize the flow and practice it in real DOM scenarios Happy to connect with fellow developers and discuss more 🚀 #javascript #frontend #webdevelopment #interviewpreparation #reactjs
To view or add a comment, sign in
-
Advanced Password Generator I just built a dynamic password generator using HTML, CSS & JavaScript! 💻 Features include: Choose letters, numbers, and symbols Set your preferred password length Strength indicator shows Weak / Medium / Strong Copy to clipboard with one click It’s a simple tool but a great exercise in: DOM manipulation & event handling in JavaScript Styling interactive UI components with CSS Enhancing user experience with instant feedback A little project with big learning value. Always experimenting and leveling up! #JavaScript #WebDevelopment #Frontend #HTML #CSS #UIUX #CodingFun #InteractiveDesign #PasswordSecurity
To view or add a comment, sign in
-
Day 18 of my JavaScript learning journey 🚀 Today, I improved my Contact Form Validation project by making it more interactive and user-friendly. Instead of just showing errors on submit, I implemented real-time validation, so users get instant feedback as they type. Here’s what I added: • Live validation using onkeyup • Proper validation for: * Full name (format check with regex) * Phone number (digits + length check) * Email (pattern validation) * Message (minimum character requirement) • Dynamic error messages that update instantly • Visual success indicators (check icons ✔️) • Cleaner and more structured validation functions One thing I really noticed today is how much small UI feedback improves user experience. Now the form actually guides the user instead of just reacting after submission. I also started thinking more about how users interact with forms, not just how the code works. Next step: building an Image Gallery 🔥 #JavaScript #WebDevelopment #Frontend #100DaysOfCode #LearningInPublic
To view or add a comment, sign in
-
-
Day 16 of my JavaScript journey 🚀 Built a Drag and Drop Interface using HTML, CSS, and JavaScript. Users can drag items and drop them into different containers with smooth interaction. This project helped me practice: • Drag and Drop API • Event handling • DOM manipulation • Building interactive UI 🔗 Live Demo: https://lnkd.in/gvWBT7tJ 💻 GitHub Repo: https://lnkd.in/gJDK4_AP Learning how to create more interactive and user-friendly web experiences. 💻 #JavaScript #WebDevelopment #FrontendDeveloper #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
🚀 Understanding the JavaScript Event Loop (In Simple Terms) If you’ve ever wondered how JavaScript handles multiple tasks at once, the answer lies in the Event Loop. 👉 JavaScript is single-threaded, meaning it can execute one task at a time. 👉 But with the help of the Event Loop, it can handle asynchronous operations efficiently. 🔹 How it works: 1. Call Stack – Executes synchronous code (one task at a time) 2. Web APIs – Handles async operations like setTimeout, API calls, DOM events 3. Callback Queue – Stores callbacks from async tasks 4. Event Loop – Moves tasks from the queue to the call stack when it’s empty 🔹 Microtasks vs Macrotasks: - Microtasks (Promises, MutationObserver) → Executed first - Macrotasks (setTimeout, setInterval, I/O) → Executed later 💡 Execution Order Example: console.log("Start"); setTimeout(() => { console.log("Timeout"); }, 0); Promise.resolve().then(() => { console.log("Promise"); }); console.log("End"); 👉 Output: Start End Promise Timeout 🔥 Key Takeaways: ✔ JavaScript doesn’t run tasks in parallel, but it handles async smartly ✔ Microtasks always run before macrotasks ✔ Event Loop ensures non-blocking behavior Understanding this concept is a game-changer for writing efficient and bug-free JavaScript code 💻 #JavaScript #FrontendDevelopment #WebDevelopment #ReactJS #Programming #EventLoop
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development