Problem with innerHTML

1

I want to replace the text of an html element that contains a link, to which I added the corresponding ID:

This code works (without the link):

<script>
var titleChange = document.getElementById("navceth").innerHTML = "<a>CETH</a>";
</script>

But when I incorporate the link inside the innerHTML to replace, it does not work.

Any suggestions?

    
asked by Arte Digital Publicitario 15.02.2017 в 21:37
source

1 answer

0

treat like this:

<script>
var titleChange = document.getElementById("navceth").innerHTML = "<li id=\"navceth\"><a href=\"ceth.html\">Centro de Estudios en Tecnología del Hormigón<\/a><\/li>";
</script>
    
answered by 15.02.2017 / 23:04
source