I have one list, so I when I click on the button it should hide all li but not that li who has class name "matter" so how to do this using jquery by using only the class name.
<ul class="sub-menu">
<li >list 1</li>
<li class="matter">list 2</li>
<li >list 3</li>
<li >list 4</li>
</ul>
<button name="btn" class="btn_click">Click me</button>
$(".btn_click").on('click', function() {
// here code that will hide all li but not that li who has class name 'matter'
});