Tell us what’s happening:
Your code so far
setTimeout(() => {
const element = document.getElementById(“inputVal”);
}, obj.showMsgDelay);
});
};
setTimeout(() => {
const element = document.getElementById(“inputVal”);
}, obj.showMsgDelay);
});
};
Please Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!
i have problem on step 104 of learn-
recursion-by-building-a-decimal-to-binary-converter
what problen do you have?
this is the instruction I suppose to follow:
You used the inputVal
property as the id
attribute for your paragraph elements. Now you can target those the paragraph elements with those id
s.
Use the .getElementById()
method to select the element with the id
attribute with the value of the inputVal
property of the current object.
then tis is how I’m trying write the code:
setTimeout(() => {
document.getElementById(“inputVal”);
}, obj.showMsgDelay);
});
};
it doesn’t look like you are using any property of object, you are using a string which is not what you should be using
Please, explain more!!!
what could be the inputVal
property of the current object?
You mean this???
setTimeout(() => {
document.getElementById(“obj.inputVal”);
}, obj.showMsgDelay);
});
};
if you write it as a string you can’t get the value from the object
Okay, it works!!!
but why not in string if I may ask???
Because, I used to pass id name of element as string???
because you want the value from obj.inputVal
, you are not searching for an id that is exactly "obj.inputVal"
Right, now I get it.
Again, thank you so much for your help!!!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.