<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.test{
background-color: #008000;
}
.red{
background-color: #FF0000;
}
</style>
</head>
<body>
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item test">test</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
<div class="item">10</div>
<script>
function nextAll(elem) {
var next = false;
return [].filter.call(elem.parentNode.children, function(child) {
if (child === elem) next = true;
return next && child !== elem
})
};
var div = document.querySelector(".test"), next = nextAll(div);
next.forEach(function(el) {
el.classList.add('red');
});
</script>
</body>
</html>