Tell us what’s happening:
Step 104
You used the inputVal property as the id attribute for your paragraph elements. Now you can target those the paragraph elements with those ids.
Use the .getElementById() method to select the element with the id attribute with the value of the inputVal property of the current object.
Your code so far
const showAnimation = () => {
result.innerText = "Call Stack Animation";
animationData.forEach((obj) => {
setTimeout(() => {
animationContainer.innerHTML += `
<p id="${obj.inputVal}" style="margin-top: ${obj.marginTop}px;" class="animation-frame">
decimalToBinary(${obj.inputVal})
</p>
`;
}, obj.addElDelay);
setTimeout(() => {
let obj = document.getElementById("inputVal.value")
}, obj.showMsgDelay);
});
};
I’m confused by the wording in this step. The .getElementById() method as I understand it will return the value of what I put in the quotes to a variable I assign.
This is what I have for this Step:
const obj = document.getElementById("inputVal.value")
The method should find inputVal.value and assign it to obj. This seems redundant to me.
The console is giving me this:
// running tests
You should use the .getElementById() method to target the element where the id attribute matches the value of inputVal for the current object.
// tests completed
Can anyone explain this Step in more detail?
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Challenge Information:
Learn Recursion by Building a Decimal to Binary Converter - Step 104