Course Content
Advanced JavaScript Mastery
Advanced JavaScript Mastery
1. Mastering JavaScript Classes and Inheritance
Getting StartedUnderstanding Class Declarations in JavaScriptChallenge: Create a JavaScript ClassDefining Methods in JavaScript ClassesChallenge: Add Methods to a ClassUsing Parameter ObjectsWorking with Private Properties in ClassesChallenge: Implement Private Properties in a ClassManaging Properties with Getters and SettersChallenge: Implement Getters and Setters in a ClassExploring Static Properties in JavaScriptUsing Static Methods in JavaScriptChallenge: Implement Static Properties and Methods in a ClassUnderstanding Inheritance with extends and super()Challenge: Implement Class Inheritance with extends and super()
2. DOM Manipulation for Interactive Web Development
What Is the Document Object Model (DOM)?Querying and Selecting Elements in the DOMChallenge: Query and Select DOM ElementsUnderstanding the DOM Hierarchy and RelationshipsChallenge: Navigate the DOM HierarchyExploring DOM Properties in JavaScriptWorking with Element Attributes in the DOMChallenge: Manage Element Properties and AttributesAdding Elements to the DOM DynamicallyRemoving Elements From the DOMChallenge: Add and Remove DOM ElementsModifying Element Styles with JavaScriptChallenge: Apply Dynamic Styles to DOM Elements
3. Event Handling and User Interactions in JavaScript
4. Asynchronous JavaScript and API Integration
Introduction to Asynchronous JavaScriptUnderstanding Callbacks in JavaScriptHandling Asynchronous Operations with PromisesUsing Async/Await for Cleaner Asynchronous CodeFetching and Working with APIs in JavaScriptIntegrating APIs in JavaScript ApplicationsChallenge: Fetch and Use API DataIntegrating Third-Party Libraries in JavaScriptChallenge: Work with Third-Party LibrariesHandling Multiple Asynchronous Requests
Challenge: Implement Event Listeners
Task
You're building a form where users can submit their details. Your goal is to validate user input, provide real-time feedback as they type, and prevent form submission if the input is invalid.
- Real-Time Input Feedback:
- Listen for changes as the user types;
- Inside the event handler, check the length of the input value;
- If it's less than 3 characters, set the content of the
<p>
with IDfeedback
to"Name is too short."
; - If it's 3 characters or more, set
feedback
to"Name looks good!"
.
- Prevent Default Form Submission:
- Listen for form submissions;
- Stop the form from the default submitting behavior;
- Check the input value;
- If it's less than 3 characters, display
"Please enter a longer name"
in the<p>
with IDform-message
; - If it's 3 characters or more, display
"Form submitted successfully!"
inform-message
.
index.html
index.css
index.js
- Use the
input
event to listen for changes as the user types; - Use
event.target.value.length < 3
to check the length of the input value; - Use the
submit
event to listen for form submissions; - Use
event.preventDefault()
to stop the form from the default submitting behavior; - Use
nameInput.value.length < 3
to check the input value.
index.html
index.css
index.js
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 3