I have a very simple function, yet it gives the statement "missing semicolon".
The code is as follows:
window.onload = function () {
var title = document.getElementsByTagName("title")[0].innerHTML;
document.getElementsByTagName("H1")[0].innerText = title;
}
What am i missing here?
>Solution :
you have missing the semicolon at end
window.onload = function () {
var title = document.getElementsByTagName("title")[0].innerHTML;
document.getElementsByTagName("H1")[0].innerText = title;
};