# Button and new tab

**URL:** <https://discourse.nodered.org/t/button-and-new-tab/21984>\
**Category:** General\
**Created:** [19 February 2020 14:28 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984 "2020-02-19T14:28:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibou](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@bibou](https://discourse.nodered.org/u/bibou)\
**Post date:** [19 February 2020 14:28 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/1 "2020-02-19T14:28:11Z")

</div>

Hello, so I have a dashboard that contains a button. I would like to know if it is possible on node-red to automatically click this button; the ideal will be that it opens in a new tab. Is it possible?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 February 2020 14:44 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/2 "2020-02-19T14:44:06Z")

</div>

> [@bibou](#):
>
> node-red to automatically click this button; the ideal will be that it opens in a new tab.

I don't understand what you mean. When you click a button it sends a message back to the server, you can make your flow emulate that just by sending the same message. I don't see what that has to do with "it opens in a new tab ". What opens in a new tab?

---

<div class="post-metadata">

**Author:** ![bibou](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@bibou](https://discourse.nodered.org/u/bibou)\
**Post date:** [19 February 2020 14:50 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/3 "2020-02-19T14:50:52Z")

</div>

Maybe use a button for that it's not a good idea but I have a http URL and I want to open this URL on chrome automaticly

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 February 2020 15:12 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/4 "2020-02-19T15:12:10Z")

</div>

Why not just use a normal html link to the page you want to open? If you include in the URL `target=”_blank”` then it should open it in a new tab in the browser.

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [19 February 2020 15:14 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/5 "2020-02-19T15:14:08Z")

</div>

> [@bibou](#):
>
> the ideal will be that it opens in a new tab

So what you have is a link, which as Colin describes can be added `target="_blank"` to to have it open in a new tab.  
As for automatically clicking that, you can use javascript: [HTMLElement: click() method - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click), connected to whatever you need for it.

---

<div class="post-metadata">

**Author:** ![bibou](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@bibou](https://discourse.nodered.org/u/bibou)\
**Post date:** [20 February 2020 07:54 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/6 "2020-02-20T07:54:53Z")

</div>

good ! Do you know now how to do the same thing with target but not to open a new tab but a new windows, new instance of chrome ?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [20 February 2020 08:09 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/7 "2020-02-20T08:09:31Z")

</div>

New windows are usually blocked by the browser’s builtin popup blocker so you’ll need to go into the settings/whitelist the page first.  
Scroll down to target here: [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 April 2020 08:09 UTC](https://discourse.nodered.org/t/button-and-new-tab/21984/8 "2020-04-20T08:09:42Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
