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

Tell us what’s happening:

You have set the id attribute for your paragraph elements to the obj.inputVal property.

Now, use getElementById to select the element with that attribute value, again using the obj.inputVal property.

I think what he wants to do is select that element and replace the text content of that element but I am unable to get that element by Id. can someone please help by rephrasing or telling me how I am wrong. Thank you in advance.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

      document.getElementById(`${obj.inputVal}`);

// User Editable Region

Your browser information:

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

Challenge Information:

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

Hi there!

You didn’t need to add template literals and embedded expression. The template literals are used for getting a value as a text.

it is still not working without the template literals but I do think embedded expression needs to be used because then it won’t make sense.

The information you need is stored in the variable obj.inputVal property. You don’t put quotes or backticks around it.

1 Like

Edit:

        <p id="${obj.inputVal}" style="margin-top: ${obj.marginTop}px;" class="animation-frame">

You have already embedded it within the inner HTML in previous challenge step.

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