src/Document.php
/**
     * Creates a new Attr object that with the given name.
     *
     * @see https://dom.spec.whatwg.org/#dom-document-createattribute
     *
     * @throws \Rowbot\DOM\Exception\InvalidCharacterError
     */
Creates a new Attr object that with the given name.


Creates a new Attr object that with the given name .
public function createAttribute(string $localName): Attr
    {
        if (!preg_match(Namespaces::NAME_PRODUCTION, $localName)) {
            throw new InvalidCharacterError();
        }
        if ($this instanceof HTMLDocument) {
            $localName = Utils::toASCIILowercase($localName);
        }
        return new Attr($this, $localName, '');
    }
public function createAttribute ( string $ localName ) : Attr { if ( ! preg_match ( Namespaces :: NAME_PRODUCTION , $ localName ) ) { throw new InvalidCharacterError ( ) ; } if ( $ this instanceof HTMLDocument ) { $ localName = Utils :: toASCIILowercase ( $ localName ) ; } return new Attr ( $ this , $ localName , '' ) ; }
Creates a new Attr object that with the given name.
Creates a new Attr object that with the given name .
// If localName does not match the Name production in XML, then // throw an InvalidCharacterError.