I'm having a problem testing some code I wrote. Here is the error...
What does it mean 'not defined'? I have defined the function (I assumed), so what else is it referring to?Error: translateEn is not defined
Line: 1
...and the code.
Thanks in advanceCode:<script> var function translateEn() { document.getElementById("translateHeader1").innerText = translation.header1; document.getElementById("translateContent1").innerText = translation.content1; } // *** TRANSLATION *************************** var translation { header1: 'In English', content1: 'This text is in English.' } // ************************************************* </script> <p> <button id="translateButton" onclick="translateEn()">English translation</button> </p> <h1 id="translateHeader1">Suomeksi</h1> <p id="translateContent1">Tämä texti on suomeksi.</p>![]()


Reply With Quote

Bookmarks