javascript - If class other than my class is present -


i have dynamic list looks

<li>item 1</li> <ii>item 2</li> <ii class="route2">item 2</li> <ii>item 3</li> <ii>item 4</li> 

and 2 buttons

<button>route one</button> <button>route two</button> 

i can't work how show route 2 button if list items have route2 class.

this should work:

if ( $('li').not('.route2').length ){     $('button').hide(); } 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -