mardi 1 septembre 2015

use .hasClass() in jquery with if clause

Is it valid to use an if clause with .hasClass()?

Example:

if ($(this).hasClass("class")){
    this will happen
}

Or

if ($(this).hasClass("class") == true){
    this will happen
}

Aucun commentaire:

Enregistrer un commentaire