[Solved] query add .css if div has active class


IDs must be unique, so use instead: (and close all UL tags)

<ul>
    <li>
        <a class="left-menu">Test</a>
        <ul style="display: none" class="submenu">
            <li>test</li>
            <li>test</li>
        </ul>
    </li>
    <li>
        <a class="left-menu active">Test 2 </a>
        <ul style="display: none" class="submenu">
            <li>test</li>
            <li>test</li>
        </ul>
    </li>
</ul>

And then:

jQuery(document).ready(function($) {    
        $(".left-menu.active").next('.submenu').show();
});

BTW, you could use: $(".left-menu.active").next('.submenu').show();

SEE DEMO

3

solved query add .css if div has active class