I can't seem to get this to work. I have two DIV blocks, one blue and one pink; I want one to disappear when I click on the text that says "click", and vice versa. But when I post, random spaces seem to be inserted in the getElementById statement.
Is there another way to accomplish what I'm trying to do?
Feel free to take a look at the code
<div id="blockone" style="width:500px; height: 250px; background-color:#f3225d;"><span onclick="document.getElementById('blockone').style .display='none';document.getElementById('blocktwo' ).style.display='block'" style="font-weight:bold">Click</span> ejeskfld</div><div id="blocktwo" style="width:500px; height: 250px; background-color:#729dfe;"><span onclick="document.getElementById('blocktwo').style .display='none';document.getElementById('blockone' ).style.display='block'" style="font-weight:bold">Click</span> dfdfsdsd</div>
Is there another way to accomplish what I'm trying to do?
Feel free to take a look at the code
<div id="blockone" style="width:500px; height: 250px; background-color:#f3225d;"><span onclick="document.getElementById('blockone').style .display='none';document.getElementById('blocktwo' ).style.display='block'" style="font-weight:bold">Click</span> ejeskfld</div><div id="blocktwo" style="width:500px; height: 250px; background-color:#729dfe;"><span onclick="document.getElementById('blocktwo').style .display='none';document.getElementById('blockone' ).style.display='block'" style="font-weight:bold">Click</span> dfdfsdsd</div>
Comment