If I click on a specific list item then it will goes to up in the list. For example if i click on Price list it show above of the color list.
function setOnTop() {
var listItems = document.querySelector("li");
for (var i = 0; i < listItems.length; i++) {
listItems[$i].addEventListener("click", function() {
//Move on top
});
}
}
<ul>
<li>Color</li>
<li>Size</li>
<li>Price</li>
</ul>