Design comparison
Solution retrospective
Definetly the mobile view mode
What challenges did you encounter, and how did you overcome them?the calculation of the mortgage was too hard but thanks to an AI, it gave me a good formula , so i built my code using it
What specific areas of your project would you like help with?i cannot add class list in javaScript that involves adding children class from parents . for instance in the code i wanted to add .money-input div errorMode , to .money-input div, using javascript but i cannot add the class, i could only add a direct class like .money-input and toggle it but not those chilldren element that am refering to . Please whoever is reading this , pls help me with this code , i truly will be grateful šš
Community feedback
- Account deleted
To select a nested element, use the descendant combinator. This is simply a space between the parent and child selectors.
For example, given this HTML:
<div class="money-input"> <div>SELECT ME</div> </div>
You can select the inner div using JavaScript like this:
const innerDiv = document.querySelector('.money-input div'); console.log(innerDiv); // Outputs the inner <div> element
Once you have a reference to the inner div, you can manipulate it like any other element. For instance, to add a class named "CLASS_TO_ADD":
innerDiv.classList.add("CLASS_TO_ADD");
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord