.hasClass()
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
-
className
{String}
The part of the className to search for.
-
value
{Boolean | function()}
OptionalIf provided uses this as a check before continuing to the next action.
-
timeout
{Number}
Optionaloverrides FuncUnit.timeout. If provided, the wait will fail if not completed before this timeout.
-
success
{function()}
Optionala callback that will run after this action completes.
-
message
{String}
Optionalif 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.