How to detect a class is active in php or in javascript/jquery [duplicate]

I have the following html codes:

    <li class="imagenav active">
      some codes go here
    </li>

Is there a way of checking if imagenav class is active using PHP or jQuery script? for example:

    if imagenav is active {
      do some codes here ...
    }

Many thanks in advance.