phpQueryObject::index PHP Method

index() public method

..
public index ( $subject ) : integer
return integer
    public function index($subject)
    {
        $index = -1;
        $subject = $subject instanceof self ? $subject->elements[0] : $subject;
        foreach ($this->newInstance() as $k => $node) {
            if ($node->isSameNode($subject)) {
                $index = $k;
            }
        }
        return $index;
    }