How can I remove the height CSS property from my div
with id balls-conatiner
? Below is the method used but it is not working.
$('#btn').on('click', function() {
var $container = $('#balls-container');
const div = document.createElement('div');
div.classList.add('ball');
$container.append(div);
$container.css({
height: "",
});
})
$conatiner.removeProp('height')
and also
$container.css({ height: "", });
but nothing is working.
3
Answers
Try replacing
with
in the place of auto you can add any values
Try this
var ballsContainer = document.getElementById(‘balls-container’);
ballsContainer.style.removeProperty(‘height’);
use
$container.style.height = "";