Hopefully this is an easy question. I have a `div` that I want to toggle hidden/shown with a button

```
<div id="newpost">

```
['https://Stackoverflow.com/questions/4528085', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/547794/']
Try with opacity

```css
div { transition: all 0.4s ease }
.hide { opacity: 0; }
```

```html
<input onclick="newpost.classList.toggle('hide')" type="button" value="toggle">

<div id="newpost">Hello</div>
```
You could use the following:

`mydiv.style.display === 'block' = (mydiv.style.display === 'block' ? 'none' : 'block');`