Rasy,
строка 71 лишняя, сделана только для вывода сообщения
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<style>
body {
font-family: 'Roboto', sans-serif;
font-size: 1rem;
}
input[type="text"] {
font-size: 1rem;
float: left;
width: 45%;
height: 35px;
text-indent: 10px;
color: #393939;
border: 1px solid #cccccc;
background: aliceblue;
}
.selection {
margin: 8px 0;
padding: 10px;
border: 1px solid #dadada;
background-color: azure;
}
.mes.ok{
color: rgb(0, 0, 205);
}
.mes{
color: rgb(255, 0, 0);
}
</style>
<input type="text" class="filter" id="filter-price" />
<input type="text" class="filter" id="filter-space" /><br>
<p class="mes ok">All</p>
<div data-price="1000" data-space="10" class="selection">DIV 1</div>
<div data-price="1500" data-space="20" class="selection">DIV 2</div>
<div data-price="2000" data-space="30" class="selection">DIV 3</div>
<div data-price="3500" data-space="40" class="selection">DIV 4</div>
<div data-price="5000" data-space="50" class="selection">DIV 5</div>
<script data-require="jquery@3.0.0" data-semver="3.0.0" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
<script>
$(function() {
var c = $(".filter"),
a = $(".selection"),
d = $(".mes");
c.on("input", function() {
var b = +c[0].value || 0,
e = +c[1].value || 0,
b = a.filter(function(c, a) {
return +$(a).data("price") <= b && +$(a).data("space") >= e
});
b.length ? (a.hide(), b.show(), d.text(b.length + " kol"),d.addClass("ok")) : (a.show(), d.text("no"),d.removeClass("ok"));
;
})
});
</script>
</body>
</html>