0
Friends, I would like to hide an element of the page when the screen is on a certain pixel! I got in this format, but when I open screen on the given pixel, the page Showing the element, the element only hides when I set the screen size dragging with the mouse.
<html lang="en">
<head>
<title>Teste JS</title>
<script>
window.onresize = function() {
var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var x = document.getElementById("teste");
if (w < 375) {
x.style.display = "none";
}
};
</script>
</head>
<body>
<select id="teste">
<option value="">Teste</option>
<option value="">Teste</option>
</select>
</body>
</html>
It worked buddy! thank you very much!
– PCP84