I have a dropdown data-filter using it with isotope plugin.

I'm trying to close a dropdown which is open when another list item is clicked and have the arrow twirl down when the dropdown is open.

I would like to know how I can achieve this.

**here is my** [jsfiddle](http://jsfiddle.net/aUkku/3/)

```
        function toggle_visibility(id) {
        var e = document.getElementById(id);
        if(e.style.display == 'block')
            e.style.display = 'none';
        else
            e.style.display = 'block';

    }

    $('#nfbt #nfbtv').click(function(){
        $(this).toggleClass('fbt nfv');
    });

```

i used the jquery from a tutorial so it is in the html itself it does not work if i move it to its own .js file.