I'm a JS beginner, and I made a JS code for a dropdown menu, it is working very good, but because of a wordpress configuration I need to change my code. Now it's not ID's attributes but Class, the names are still the same, but I just want to change ID to class.

Here is my small JS code : 

```
var linkId = "dropdown-" + $(this).attr("id");
                if ($('.dropdown-sub').is(':animated')){
                    //do nothing
                } else {
                    $('.dropdown-sub').each(function() {
                        if ($(this).attr("id") !== linkId) {
                            if($(this).hasClass('open-dd')) {

                                $(this).slideUp();
                            }
                            $(this).removeClass('open-dd');
                        } else {
                            if($('#' + linkId).hasClass('open-dd')) {

                                $('#' + linkId).slideUp();
                                $('#' + linkId).removeClass('open-dd');
                            }
                            else {
                                $('#' + linkId).slideDown();
                                $('#' + linkId).addClass('open-dd');
                            }
                        }
                    }); 
                }
            });
        });

```

HTML:

```
<nav id="menu-link" class="menu-link cacher-menu">
            <ul class="optionel">
                <li  class="first primary-nav first">
                    <a><span class="menu-text">Un groupe individuel en évolution</span></a>
                    <span class="font-awesome f1"></span>
            <div class="dropdown-sub dropdown-first">
                <div class="dd-e">
                    <ul>
                        <li>
                            <a href="#">200 ans d'histoire</a>
                        </li>
                        <li>
                            <a href="#">Une multitude d'activités</a>
                        </li>
                        <li>
                            <a href="#">Une mosaïque de sociétés</a>
                        </li>
                        <li>
                            <a href="#">Une présence internationale</a>
                        </li>
                        <li>
                            <a href="#" class="last">Des femmes et des hommes</a>
                        </li>
                    </ul>
        </div>

```

If you want more informations about this problem ask me directly. Thank you. Andrew Bernard