Getting the original CSS min-height value
Getting the original CSS min-height value
by Darren Gates
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<div id="sample">
How do I get the min-height as the actual "5vw" string that was set in the CSS originally?
</div>
<div id="height-val"></div>
CSS
#sample {
min-height: 5vw;
background-color: yellow;
padding: 1em;
}
JavaScript
$(document).ready(function() {
var height = $('#sample').css('min-height');
$("#height-val").html('height = ' + height);
});