Automatically translated.View original post

Dom events/ javascript

# Web Site Writing Basics

# javascript

# Dom_ events

DOM Event or Event is the signal or notification that the browser sends out when certain events occur on the page. In other words, Event is the key to making a still HTML web page become an interactive web application with the user. 💡 The relationship between DOM and EventDOM (Document Object Model): It's like the structure or map of the entire web page, which consists of various Element (e.g. buttons, text, images) Event (Event): is what happens with those Element or Occurring in the Event browser, JavaScript can "eavesdrop" on these actions and "respond" with the code we set 🔔. Examples of common DOM Events Event can occur from both the actions of the user (User Action) and from the browser itself (Browser Action): groups of EventEvents (example) Meaning Mouse Eventsclick the user clicks the mouse on Elementmouseover, the user slides the mouse into the Elementdblclick, the double click the keyboard mouse Eventskeydown, the keyboard button presses, the keyup, the keyboard button releases, the keyboard forms, the Eventssubmits the user submits the form (Form), the value in the Input field, the Select Textaument / Document, the WindowPages. Element (e.g. picture) Load is complete scroll user scroll screen up or down 🔗. The method of using Event in JavaScript to use Event must be "tied" (Attach) function (also known as Event Handler) to the Element that needs eavesdropping. By the way, the most recommended method is to use addEventListener (): JavaScript / 1. Select the desired Element.

const myButton = document.getElementById ('myBtn');

/ / 2.Use addEventListener to "eavesdrop" Event

myButton.AddEventListener ('click', function () {

/ / 3.This function will be executed when the Event 'click' occurs.

alert ('You've clicked the button!');

});

When the user clicks the myBtn ID button, the alert () function will run immediately. In other words, DOM Event is where JavaScript comes to "live" and allows your web page to interact with the user.

2025/11/2 Edited to

... Read moreนอกจากการใช้งาน DOM Events ขั้นพื้นฐานแล้ว การเข้าใจความแตกต่างระหว่าง event types เช่น keydown กับ keyup ก็สำคัญไม่แพ้กัน เช่น ปุ่มคีย์บอร์ดเมื่อกดลง keydown จะถูกเรียกใช้ทันที ส่วน keyup จะถูกเรียกใช้ตอนปล่อยปุ่ม ทำให้เราสามารถควบคุมพฤติกรรมของผู้ใช้ได้ละเอียดขึ้น ในบางกรณี การใช้ addEventListener ยังช่วยให้เราสามารถเพิ่ม event handler หลายๆ ตัวลงใน element เดียวกันโดยไม่ทับซ้อนกัน ต่างจากการใช้ inline event หรือการกำหนดแบบเก่า นอกจากนี้ การเข้าใจกลไก Event Bubbling และ Capturing ใน DOM จะช่วยให้จัดการ event ได้มีประสิทธิภาพมากขึ้น เช่น การเลือกจับ event ที่ element ต้นทางหรือทะยานขึ้นไปยัง ancestor สำหรับผู้ที่อาจเจอปัญหา 500 internal server error apache ตอนทดสอบ JavaScript บนเว็บเซิร์ฟเวอร์ แนะนำตรวจสอบองค์ประกอบฝั่งเซิร์ฟเวอร์และการตั้งค่าการรับส่งข้อมูลพร้อม รวมถึงสิทธิ์ในการเข้าถึงไฟล์ด้วย สุดท้าย อย่าลืมทดสอบการใช้งาน event ในหลากหลายเบราว์เซอร์และอุปกรณ์เพื่อให้แน่ใจว่าเว็บแอปของคุณมีความเสถียรและประสบการณ์การใช้งานที่ดีทั้งบนเดสก์ท็อปและมือถือ

Related posts

My Programming Interest Just Skyrocketed! 🚀
I just discovered something that has made my interest in programming explode to 1000000000000000%! 🤯 🎮 Learning Programming is Like a Game Adventure! From Python, Java, JavaScript, to HTML, there are all kinds of programming languages available, along with systematic topic courses. The learning p
Valder

Valder

2173 likes

How I’d Learn JavaScript If I Were Starting Again
#javascript #coding #programming #tech #codingforbeginners
Aysha

Aysha

124 likes

A young woman with long dark hair, wearing a pink satin shirt, smiles at the camera while sitting at a table. Overlay text reads: 'Tools and sites I use as a cybersecurity student to progress my skills and keep me interested in studying'.
A screenshot of 'The Hacker News' website, displaying various cybersecurity news articles from January 2025, including topics like vulnerabilities, malware, cyber espionage, and AI jailbreak methods. An ad for Zscaler and a banner for CIS Hardened Images are also visible.
A screenshot of the O'Reilly learning platform, showing various books and expert playlists related to AI, engineering, and data. Overlay text highlights the subscription cost ($50/month or $499/year) and its value for accessing books and live events.
Tools and sites I use as a cybersecurity student 🌸
#cybersecuritystudent #cybersecurity #techgirlie
LexiStudies

LexiStudies

116 likes

A pink mechanical keyboard with glowing keys and colorful string lights, overlaid with text that reads "LEARN SOFTWARE DEV FOR FREE 6 RESOURCES," indicating a guide to free software development learning.
A guide titled "1. LEARN THE INTERNET" for beginners, listing key concepts like HTTPS and DNS. It recommends "Front End Masters - Sections 1-4" and shows the cover of "The Front End Developer/Engineer Handbook 2024."
A guide titled "2. LEARN HTML/CSS" for beginners, highlighting key concepts like web page structure and CSS Flexbox. It recommends "FreeCodeCamp - Responsive Web Design Course" and displays a screenshot of the course page.
Study to be a Frontend Dev - Roadmap (100% Free)
This is a study guide for becoming a Front End Developer! All resources mentioned are FREE. Don’t pay anyone for this info! Why am I not recommending a zero to job course? Two Reasons 1-There is no course that will teach you everything 2-You need to put in some sweat equity, only wat
Study Seal

Study Seal

688 likes

Did you know??
That your phone logs your websites you visit even if they are deleted? Here I’m going to teach you how to access your website data, so that you can check and delete both yours (and others😉🤪) website history. #relationshiptips #Couple #toxicrelationship #Lemon8 #christmas
Kristin🔆🔍

Kristin🔆🔍

54 likes

A scenic view of a coastal town with white buildings and blue sea, featuring text overlay "3 websites for free tech certifications BEGINNER FRIENDLY".
A person in a straw hat looking at a white-washed coastal town, with text overlay "1. Google Skillshop Google Analytics Individual Qualification Google Ads Certifications".
A person looking at a white-washed coastal town with pink flowers, featuring text overlay "2. Microsoft Learn Microsoft Azure Fundamentals Power BI Data Analyst Associate".
3 websites for free tech certifications - beginner
1. Google Skillshop - What It Offers: Free certifications in Google products like Google Analytics, Google Ads, and Google Cloud. - Best For: Digital marketing, data analysis, and cloud computing beginners. - Key Certifications: - Google Analytics Individual Qualification
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

916 likes

A desk setup featuring a Dell monitor, a white CHERRY keyboard, and a pink mouse, with the text overlay "easy coding projects for beginners" and a "LEARN MORE" button.
A white note card listing "Easy coding projects for beginners" including a to-do list app, personalized calculator, weather app, and simple quiz game, with descriptions for each.
An outdoor scene with a wide road lined by palm trees and buildings under a clear blue sky, with the text overlay "Comment 💻 if you'll try these projects!"
Easy Coding Projects!!
If you want to learn how to code then these are the perfect beginner projects! Here are some fun and easy projects to build your skills: To-Do List App: Create a simple app where you can add, edit, and delete tasks—perfect for practicing JavaScript or Python. ✅ Personalized Calculator: Build a
CompSkyy

CompSkyy

172 likes

A man with tattoos and a cap sits at a desk, coding on a large monitor in a dimly lit room. Text overlays read 'SWIPE', 'Learning JavaScript?', and 'This is for YOU!', with a thinking emoji, promoting coding education.
A man with headphones and a cap codes at a desk with a large monitor displaying code. Text overlays read 'SWIPE', 'Break vs Continue', and 'In JS loops', with a thinking emoji, highlighting JavaScript loop concepts.
A man with headphones and a cap sits at a desk, coding on a large monitor in a bright room. Text overlays read 'Let's Discuss!' with a thinking emoji, inviting interaction about coding topics.
Coding W/ JavaScript?
As a software engineer w/ ADHD, understanding the difference between certain syntax keywords is critical, such as ‘continue’ and ‘break’ within JavaScript loops.💡 It’s almost like centering a <div> — it takes practice to feel confident in your abilities. 🛠️ When my mind gets stuck in a
Michael Burbank

Michael Burbank

13 likes

revise with chatGPT using ✨active recall✨
I mean AI is gonna take over the world so might as well make use of it… 🧚‍♀️ but yesss active recall was something I was always told was the right way to do but during revision time I never really created my own questions to test yourself so here’s a way! 💯 study hard pals 💅 #lemon8singa
Leena

Leena

122 likes

These sites saved my brain in 2025 🧠💻
1. ChatHub I used to bounce between AI platforms, copy-pasting the same prompt over and over to compare answers. With ChatHub, I can talk to multiple AIs at the same time, in one clean interface. It’s honestly my go-to whenever I’m brainstorming content, writing study scripts, or just curious whi
emilie.studygram

emilie.studygram

563 likes

Hobbit Door
Thank you so much @EtherealEventCo for planning such a cozy craft night, perfect for fall! 🍂🍄🤎 If you missed this craft, follow Ethereal Event Co, or check the link in our bio for other upcoming events. #bookdomapothecary #cozycrafts #fall #lordoftherings #thehobbit
Bookdom.Apothecary

Bookdom.Apothecary

7 likes

Powerful Websites
#software #fy #fypシ゚viral #businesssoftware #freewebsites
Tha Smoke Websites

Tha Smoke Websites

189 likes

A woman in a car with the text overlay "BREAK INTO TECH 5 PRACTICAL STEPS," serving as the title image for an article on career advice.
A car interior view with text overlays detailing the first two steps to break into tech: "1. Learn the Fundamentals of Programming" and "2. Specialize in a Tech Area."
A scenic view of a city skyline and water with text overlays outlining the remaining steps: "3. Build a Portfolio," "4. Network in the Tech Community," and "5. Gain Practical Experience Through Internships or Freelancing."
BREAK INTO TECH FROM ANY INDUSTRY 👩‍💻
1. Learn the Fundamentals of Programming - Details: Mastering basic programming skills is crucial for many tech roles. Languages like Python, JavaScript, and Java are widely used and are great starting points for web development, data science, and software engineering. Understanding programming
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

84 likes

free tech certifications - 3 websites
1. freeCodeCamp • Why it’s great: Offers free certifications in web development, data analysis, and machine learning. • Popular certs: Responsive Web Design, Data Analysis with Python, and JavaScript Algorithms. • Best for: Beginners starting with coding and tech basic
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

2175 likes

A desk setup with a computer monitor and keyboard displays the title "FREE ONLINE CERTIFICATIONS to boost your resume" for 2023, with a Lemon8 watermark.
A laptop screen shows the Hubspot Academy website, detailing the free Inbound Marketing Certification course with options to sign up via Google or Microsoft.
A laptop screen displays the Google Skillshop website, showcasing various Google Ads Certifications with options to learn, apply skills, and get certified.
FREE Online Certifications 2023 💻
Boost your resume with these FREE online certifications! You can add them to your resume or LinkedIn profile, discuss them in an interview or just use them to upskill and reskill yourself to keep pace with today’s ever-changing economy. ‌> Hubspot’s Inbound Marketing Certification: Gain kno
hannah 💟

hannah 💟

11.3K likes

A character sheet portrait of a smiling woman, a 52-year-old mom of seven, surrounded by elements reflecting her organized, resilient life. It highlights her journey balancing family, personal growth, and learning technology like Python, JavaScript, and SQL, with daily routines, goals, and affirmations for managing anxiety and ADHD.
🌹 From Python, JavaScript and SQL Books to Code Dreams: This Is Me
🌹 From Budget Books to Code Dreams: This Is Me This beautiful character-sheet portrait captures me being organized, resilient, and focused on growth. I am surrounded by planners, notebooks, coding references, roses, and inspirational reminders, I represent the perfect blend of determination and
mirandaperry05

mirandaperry05

1 like

7 core Claude Code features explained in 90 seconds.. let's go! ⚡ #aiengineer #claudecode #techtok #agenticai #edutok
lindavivah

lindavivah

1 like

Let me know if you guys have any questions , i’ll try my best to help
Abigail E.

Abigail E.

1 like

Where do I learn free coding online?
It’s FREE! DO IT! #coding #bootcamp #codingforbeginners #free #technology
CosmicMama8

CosmicMama8

17 likes

$1099 Later… Here’s the Truth About the iPad Pro✨
$1099 might sound crazy for a tablet… but here’s why this iPad Pro became my ride-or-die as a work-from-home mom and student: ✨ It’s basically my laptop, sketchbook, planner, & notebook all in one I pair it with: — Apple Magic Keyboard (hello built-in trackpad & laptop vibes!) — Apple
Byaombe •••

Byaombe •••

8546 likes

Philippians Notes✨✝️
I learned a lot studying this book and really enjoyed it. I hope that this helps you in your next Bible study!
Makenziee🤍🪩

Makenziee🤍🪩

144 likes

Best - FREE - coding sites
learning to code is important and a great look for your resume! plus it’s fun! ANYONE CAN LEARN! these are my favorite sites I’ve utilized to learn new skills! #codinggirl #codingforbeginners #embracevulnerability #shareyourthoughts #Lemon8Diary
LOLLIPOPAK

LOLLIPOPAK

2979 likes

✨ Downtown Geneva turned into an open-air showroom this weekend. ✨ The Concours d’Elegance brought together everything from rare vintage classics and antique restorations to sleek modern supercars—each one displayed like a work of art. 🚘 The craftsmanship, history, and passion behind these cars
Juliann Marie

Juliann Marie

0 likes

Full tutorial included at the end of this video - be sure to save it to your phone just in case! How to download TikTok after the ban #tiktok #tutorial #fyp
Hello Kristen

Hello Kristen

20 likes

Show on scroll website
Sample website with smooth scrolling and content showing on,y when is on screen. #CSS #html #javascript #webdevelopment
The Digital Mike

The Digital Mike

1 like

5 free productivity apps you You wish you knew ✨
Hey friend, I’ve put together some free productivity apps you must try, some of these are especially my favorites and i use them on the daily, Save for later 🤎 〰️Obsidian A markdown-based note-taking app for creating interlinked notes like a personal knowledge base. Features: Offline use, plug
Byaombe •••

Byaombe •••

760 likes

POV - It’s wedding day #bride #bridetok #weddingday #fyp #virginiabeach @Just call me Dom @Allured By Ashley
Yolonda Smith

Yolonda Smith

0 likes

The image displays the title 'Tech jobs Straight out of college + AVERAGE SALARY' over a desk setup with a laptop showing a scenic wallpaper and a monitor.
This image details the '1. Software Developer' role, including job description, skills, starting salary ($70,000-$90,000), and preparation tips, set against a background of stone steps and a blue sky.
The image presents information for '2. Data Analyst,' covering job duties, skills, starting salary ($60,000-$75,000), and preparation advice, overlaid on a street scene with buildings and people.
Tech jobs you can get in college
1. Software Developer - What You’ll Do: Design, code, test, and maintain software applications or systems, working on web apps, mobile apps, or backend systems. - Skills to Focus On: Programming languages (Python, Java, C++, JavaScript), Git, Agile methodologies. - Average Starting Sala
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

92 likes

Level up your digital calendar?! 🗓️ 👀
Obviously we all have at least a general idea of what to use a monthly calendar for.. events, appts, important dates etc. But have you ever used your calendar for something else?? 👀 One thing I like doing, is having multiple monthly calendars in my digital planner. That way I can keep everything
Allie Marie 🧚🏻

Allie Marie 🧚🏻

190 likes

🎮Try These Games When You are Free
🎮CodeCombat CodeCombat is an educational role-playing game that allows players to learn programming while having fun. In this game, players take on the role of a hero and progress through various levels by inputting code to control the hero's actions. It offers support for multiple progr
Capital&Crypto

Capital&Crypto

6 likes

A planners perspective from outside 😍 #byloveevents @Just call me Dom @isha foss design #fyp #weddingplanner #bride #weddingtok
Yolonda Smith

Yolonda Smith

0 likes

buying kpop albums and goods just got a lot easier! thank you so much to @AlbumBuddy for partnering up with me to bring more fans some relief when buying from korea and saving us some money along the way! 🥰🩷 #kpopalbums #Albumbuddy #photocard #kpopunboxing #korea
alexis paradise

alexis paradise

3 likes

Nursing Assessments in the OR — Pre, Intra & Post
Nursing Assessments in the OR — Pre, Intra & Post-Op From pre-op prep to PACU recovery, here’s your step-by-step guide for perioperative nursing. Understand your role during every surgical phase! Save this breakdown for your next clinical rotation 🩺 #PerioperativeNursing #GlowEraEd
Isdom89 💎 🦁 ♥️

Isdom89 💎 🦁 ♥️

12 likes

🚨Real Madrid News as of 12/25/25 #realmadrid #camavinga #rudiger #santiagobernabeu #tapiaa__
tapiaa__

tapiaa__

0 likes

See more