JSFiddle - React, Tailwind, and code Playground
by Chace
HTML
<div class="full">a</div>
<div class="full">b</div>
<div class="full">c</div>
<div class="full">d</div>
CSS
div.full {
background-color: tan;
margin: 1px;
}
JavaScript
$(document).ready(function() {
var height = getViewportHeight();
console.log(height);
$("div.full").each(function () {
$(this).height(height);
})
});
function getViewportHeight() {
var h = 0;
if (self.innerHeight) {
h = window.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
h = document.documentElement.clientHeight;
} else if (document.body) {
h = document.body.clientHeight;
}
return h;
}