I have the following html code
<html>
<script>
function test(){
document.getElementById('lblUser').innerText="test html";
}
</script>
<a href="#">LINK1</a>
<label id="lblUser"/>
<a href="#">LINK2</a>
<script type="text/javascript">test();</script>
</html>
While calling test() LINK2 disappears. It seems to be because of the change in lblUser.innerText. But what’s the possible way to show LINK2? And why this happens?
Label’s implementation depends on doctype, try not having label as a self-closing tag.