I am trying to change the innerHTML of the anchor element with the help of the id of the same element displayed below in the label marked “html”.
JS:
onload=function(){
var localUrl = document.URL
localUrl = localUrl.split('http://')[1].split('/');
document.getElementById('menuDomain').innerHTML = localUrl[0];
}
html: <a id="menuDomain" href=".."></a>
But the innerHTML of the anchor element remains unchanged. 🙁
It may well work better when you add a semicolon after the
document.URL…