Skip to content
PHP Ecosystem
Explore

HasTarget

API reference › HTML Attribute › HasTarget

traitUIAwesome\Html\Attribute\HasTarget
Sourcesrc/HasTarget.php
Used by 3 types

Provides an immutable API for the target attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/target.

MethodDescriptionDefined by
target()Sets the target attribute.HasTarget
public function target(string|UnitEnum|null $value): static

Sets the target attribute.

Defines the browsing context that receives the link or form submission.

Parameters

ParameterTypeDescription
$valuestring|UnitEnum|nullBrowsing context name, or null to remove the attribute.

Returns

static: New instance with the updated target attribute. Target for predefined enum values.

Throws