Visual Studio says me I have a problem whit my code, Im just starting whit Javascript and I don't know where is the problem.
Code:
DOCTYPE html
html
head
meta charset="utf-8"
title Functions/title
<meta name=" Functions" content="Functions whit days"
/head
body
p id="output"/p
img id="face"
Script type="text/javascript"
function esFinDeSemana(){
const día = new Date().getDay ();
if (dia 0 || dia === 6){
return true;
}
else{
return false;
}
let ValorSrc;
if (esFinDeSemana()){
ValorSrc = 'CaritaFeliz.png'
else{
ValorSrc CaritaTriste.png
}
document.getElementById(' face' ).src = ValorSrc;
/script
/body
/html
Top comments (4)
Hi, it'll be much easier to help you out if you copy and paste the code into the body of your post! A picture with glare makes it harder to figure out! It also is a good rule of thumb when asking for help to let people know what you are trying to achieve with your code! Otherwise we don't exactly know what specific output you are looking for.
Ok
Some comments may only be visible to logged-in visitors. Sign in to view all comments.