super beginner here:
I having trouble figuring out how to correctly use this conditional statement for a placeholder. For some reason, it only executes one condition after clicking on submit (in this case, always true) whether or not there's a string typed into the placeholder.
This is the code I have so far:
function handleObj(task){
p.textContent = 'My goal is to ' + task.toLowerCase()
if (typeof p.textContent !== 'string'){
h.textContent = 'Please type a goal'
p.textContent = ' '
submit.disabled = true;
}
};
TIA