HasNonce
API reference › HTML Attribute › Global › HasNonce
Used by 1 type
Provides an immutable API for the nonce attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
nonce() | Sets the nonce attribute. | HasNonce |
Method details
Section titled “Method details”nonce()
Section titled “nonce() ”public function nonce(string|Stringable|UnitEnum|null $value): staticSets the nonce attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Cryptographic nonce value, or null to remove the attribute. |
Returns
static: New instance with the updated nonce attribute.