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: Apply Dynamic Styles to DOM Elements
Task
You're building an interactive card that can change its appearance based on user actions. Users can change the background color of the card, resize it, and toggle a "highlighted" state for additional styling.
- Change Inline Styles: When the button is clicked:
- Change the background color of the
<div>
with IDcard
to"lightblue"
; - Set the width of the card to
"300px"
; - Add a
2px solid #333
border around the card.
- Change the background color of the
- Toggle a Highlight Class: When the button is clicked:
- Add or remove the
highlight
class on the<div>
with IDcard
.
- Add or remove the
- Add a Dark Theme Class: When the button is clicked:
- Add or remove the
dark-theme
class on the<body>
, which should switch the page's theme.
- Add or remove the
index.html
index.css
index.js
- Use
style.backgroundColor
to change the background color of the<div>
with IDcard
to"lightblue"
; - Use
style.width
to set the width of the card to"300px"
; - Use
style.border
to add a2px solid #333
border around the card; - Use
classList.toggle()
to add or remove thehighlight
class on the<div>
with IDcard
; - Use
classList.toggle()
to add or remove thedark-theme
class on the<body>
, which should switch the page's theme.
index.html
index.css
index.js
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 13