I have used javascript code to increase and decrease the height of div on click event. But i also want to apply transition-duration property so that transition goes smoothly.
Here is the css code
#content {
height: auto;
width:400px;
background-color:#F30;
transition-duration:2s;
}
#content.expand {
height: 300px;
transition-duration:2s;
}
This is the javascript code
function chk()
{
var node = document.getElementById('content');
node.classList.toggle('expand');
}
The function is working properly. I have applied transition property, but that is not working.