I would like to make a animation feature using Javascript and CSS
I want a div to appear from the top and then transition it to the full height
so start: height = 0 and end: height 200px (for example)
I know this Feature can be easly done with Jquery But i want to do it with javascript
So I can learn more using javascript.
var div = document.getElementById('div');
var btn = document.getElementById('btn');
btn.addEventListener('click', ()=>{
let h = '200px';
if (div.style.height === '200px') h = '0px';
div.style.height = h;
});
var div = document.getElementById('div');
var btn = document.getElementById('btn');
btn.addEventListener('click', ()=>{
div.classList.toggle('big');
});