I need to change css `display` value of items inside div using jQuery.
What I need to do is, get number of items inside the div element. (Ex- li elements). 

If number of `li` elements inside the div is more than 6, I need to set `display:none` css value to them, while first 6 `li` items remain `display:block`

How can I do that?

I can get number of li elements inside div by using this code,

```
$(window).ready(function () {
    var itemCount = 1;
    if ($(window).width() < 768) {
        if ($('#my-div li').length > 6) {
            var k = $('#my-div li').length;
            alert("no of items =" + k);
        }
    }
});

```

How can I achieve this?