Learn Recursion by Building a Decimal to Binary Converter - Step 105

Tell us what’s happening:

I have tried this several ways and nothing works, now the auto coder is not even working.
What are you looking for here ?

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(() => {
      document.getElementById(obj.inputVal).textContent(msg.obj);
    }, obj.showMsgDelay);
  });
};

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn Recursion by Building a Decimal to Binary Converter - Step 105

Hey there,

Please update the message to include your code. The code was too long to be automatically inserted by the help button.

When you enter a code, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

I’m slightly confused here. The title of your post says step 105, but the code you pasted above seems to be for step 106 and it is the default code. Can you clarify which step you need help with and paste in your code so we can see what you have tried?

It is step 105
here is one of the many version of my code that are getting kicked out by the auto coder
in this function
};
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(() => {
msg.obj = document.getElementById(obj.inputVal).textContent
}, obj.showMsgDelay);
});
};
It is this bit that is wrong.
msg.obj = document.getElementById(obj.inputVal).textContent
Here are the instructions

Step 105

Now that you’ve targeted the correct element, you can update its text after the delay you specified earlier.

Using the .getElementById() method, set the textContent property of the targeted element equal to the msg property of the current object.

You need to paste your code in here correctly using the method I gave you above.

t is step 105
here is one of the many version of my code that are getting kicked out by the auto coder
in this function
};
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(() => {
msg.obj = document.getElementById(obj.inputVal).textContent
}, obj.showMsgDelay);
});
};
It is this bit that is wrong.
msg.obj = document.getElementById(obj.inputVal).textContent
Here are the instructions

Step 105

Now that you’ve targeted the correct element, you can update its text after the delay you specified earlier.

Using the .getElementById() method, set the textContent property of the targeted element equal to the msg property of the current object.

Is that what you mean ?

So you can move on I found the answer in a very nice youtube that someone else posted
it is
document.getElementById(obj.inputVal).textContent = obj.msg;

this one is hard and also confusin oh lord

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.