FluentDOM\Query\Css::offsetUnset PHP Méthode

offsetUnset() public méthode

Allow to use unset and array syntax to remove a css property value on all matched nodes.
See also: ArrayAccess::offsetUnset()
public offsetUnset ( string $name )
$name string
    public function offsetUnset($name)
    {
        foreach ($this->_fd as $node) {
            if ($node instanceof \DOMElement && $node->hasAttribute('style')) {
                $properties = new Css\Properties($node->getAttribute('style'));
                unset($properties[$name]);
                if (count($properties) > 0) {
                    $node->setAttribute('style', (string) $properties);
                } else {
                    $node->removeAttribute('style');
                }
            }
        }
    }