.hasClass()

  • function
FuncUnit.prototype.hasClass  

hasClass(className [,value] [,timeout] [,success] [,message])

//returns if the element has the class in its className
F("#something").hasClass("selected");

//waits until #something has selected in its className
F("#something").hasClass("selected",true);

//waits until #something does not have selected in its className
F("#something").hasClass("selected",false);

Parameters

  1. className {String}

    The part of the className to search for.

  2. value {Boolean | function()}Optional

    If provided uses this as a check before continuing to the next action.

  3. timeout {Number}Optional

    overrides FuncUnit.timeout. If provided, the wait will fail if not completed before this timeout.

  4. success {function()}Optional

    a callback that will run after this action completes.

  5. message {String}Optional

    if provided, an assertion will be passed when this wait condition completes successfully

Returns

{Boolean | funcUnit}

if the value parameter is not provided, returns if the className is found in the element's className. If a value paramters is provided, returns funcUnit for chaining.