Html target new window
To open a link in a new window using HTML, you can use the target
attribute and set its value to _blank
. Here's an example:
<a rel="nofollow" target="_blank" href="https://www.example.com" target="_blank">Open in new window</a>
This will open the link in a new window or tab, depending on the user's browser settings.
You can also use other values for the target
attribute to specify where the link should be opened:
_self
: Open the link in the same window or tab (default behavior)_blank
: Open the link in a new window or tab_parent
: Open the link in the parent frame (if the link is contained within a frame)_top
: Open the link in the full body of the window (if the link is contained within a frame)
For example:
<a rel="nofollow" target="_blank" href="https://www.example.com" target="_parent">Open in parent frame</a>
This will open the link in the parent frame, if the link is contained within a frame.
Note that the target
attribute only works for links that are not contained within a form. If you want to open a link in a new window from within a form, you'll need to use JavaScript to achieve this.