How do I get the current step in jQuery steps wizard?

PaulG picture PaulG · Feb 9, 2015 · Viewed 15.1k times · Source

I'm looking for a way to get the current step in my jQuery Steps wizard. I would like to perform an action if the current step is step 1.

Answer

Chris picture Chris · Aug 12, 2015

This will return the current step index as an integer.

$("#wizard").steps("getCurrentIndex");

This step index is zero-based.

So, to perform an action on the first step (what I assume you mean by "step 1"), you would do:

if ( $("#wizard").steps("getCurrentIndex") == 0 ) {
    perform_action();
}

Ref: https://github.com/rstaib/jquery-steps/wiki/Methods