Javascript (Not defined error) [closed]

I’m not too sure what line of code is meant to have the error in reality – as the line highlighted doesn’t seem to be the problem. Here’s your code again:

var logo = document.createElement("img");
logo.setAttribute("src", "Images/logo_js.jpg");
logo.setAttribute("width", "175");
logo.setAttribute("height", "110");
logo.setAttribute("alt", "logo de JavaScript");

The problem line is the last line. It should be


There may be other issues within your app – but that’s the only problem line I can see in your code. It’s also easier if you just output your code here on Stackoverflow than reference it within an image.

Browse More Popular Posts

Leave a Comment