sent.addEventListener("click", function() {
player.src = value.value;
// if src is not an empty string (change your check according to your needs)
if (player.src !== "") {
console.log("src is not an empty sting")
}
// if we reach here means that src is actually an empty string
console.log("src is an empty string")
});
EDIT:
my personal preference is in general to rule out and return early when the value is not the one I want, so for example
function alertName(name) {
// fist I check that "name" is here, if not we return early
if (!name) {
return "you haven't supplied a name"
}
// if reach here means that we can assume name is provided
alert("Hello, " + name)
}
Hope it helps :+1: