Open modal window when li items in div are below 6

Open modal window when li items in div are below 6

Hi

I have a div with list items in it with the class 'card'. These list items can be dragged to a different div and dropped using the jQuery UI.

How can I tell when the amount of list items in the div are down to five (starts with about 50).

Any help is much appreciated.

Nick