public function closestParentOfType( $str ) {
        $str = strtolower($str);
        $currentEl = $this;
        
        while( strtolower($currentEl->getTagName()) != $str && $currentEl->hasParent() )
            $currentEl = $currentEl->getParent();
        
        if( strtolower($currentEl->getTagName()) != $str )
            return null;
        else
            return $currentEl;
    }