I have a div block
<div id='block'>
<a href="#" onclick="Document.getElementById('block').style = 'display: none;';">Hide</a>
</div>
and I want to be have a link that will hide the block when clicked, I tried the above but it doesn’t work I’m not sure how to get this to work, any ideas or guidance?
styleis an object which properties are assigned directly. It’s not like the HTML attribute. So what you want is: