JSFiddle - React, Tailwind, and code Playground
by Przmak
HTML
<div class="test">Test</div>
<div id="status"></div>
CSS
.test {
background: red;
height: 100px;
width: 100px;
}
@media only screen and (min-width: 400px) and (max-width: 600px) {
.test {
display: none;
}
}
JavaScript
var winWidth = 0;
$(window).resize(function() {
winWidth = $(window).width();
$("#status").text(winWidth);
});
// jquery here is only for getting to know the window width