masha2
1
const textInput = document.getElementById("text-input")
const btn = document.getElementById("check-btn")
const result = document.getElementById("result")
btn.addEventListener("click",()=>{
if(textInput.value === ""){
result.textContent="Please input a value"
}
})
why doesn’t it display text?
ILM
2
what doesn’t display text?
also, what is your html, that is needed for debugging
masha2
3
alert, but for some reason the click doesn’t work for me, or rather even the javascript itself doesn’t work in this program
lasjorg
4
Post your HTML. Your code works for me with the correct HTML and ids.
The first 3 tests should be passing. If they are not your HTML is not correct.
masha2
5
I understood what the problem is in html
system
Closed
6
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.