If li has less than 3 characters, hide?

Viewed 4614

I want to be able to hide list items that have less than 3 characters, how do I do this? What is wrong with my code below?

I am a JavaScript/jQuery newbie.

jQuery().ready(function () {
    if (jQuery('ol li').length < 3) {
        jQuery(this).hide();
    };
});
5 Answers
Related