-3
To find the input element with the desired value you should search for "input#country"
and you’re looking for "input#pais"
. The "parents" ID element does not exist in the image code you put in the question.
During the rescue of the element of input
which has the value you want to verify, you are checking the element against the string
Brazil. The correct would be, for both cases:
var country = document.querySelector("input#country")
And on condition, check the value of the element:
if (country.value === "Brasil") {
I hope I’ve helped in some way.
Please describe what the code should do and don’t put code as an image; the platform has code support.
– Woss
This answers your question? What error in my code?
– Danizavtz