# Node Red catch webpage click event

**URL:** https://discourse.nodered.org/t/node-red-catch-webpage-click-event/16582
**Category:** General
**Created:** [11 October 2019 04:18 UTC](https://discourse.nodered.org/t/node-red-catch-webpage-click-event/16582 "2019-10-11T04:18:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![briansone](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@briansone](https://discourse.nodered.org/u/briansone)
#### Post date: [11 October 2019 04:18 UTC](https://discourse.nodered.org/t/node-red-catch-webpage-click-event/16582/1 "2019-10-11T04:18:49Z")

</div>

I have built an IOT interface webpage which has clickable buttons like a window which should open/close when clicked.

The hardware side is set up (Pi --\> ESP --\> window actuator controller), & I can send a window open/close message out through an inject node in Node Red but I'm not sure what needs to be done to replace my manual inject node with webpage 'click' events.

Any ideas?

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [11 October 2019 04:32 UTC](https://discourse.nodered.org/t/node-red-catch-webpage-click-event/16582/2 "2019-10-11T04:32:36Z")

</div>

Here's a link to a project that explains how to put 'soft buttons' on a web page to turn LEDs on and off.  
I'm sure you could modify it to suit to your needs.

Please read the instructions carefully about re-naming 'index.txt' to 'index.html'.

> [@'Soft' buttons on a web page to control something via Node-RED](https://discourse.nodered.org/t/soft-buttons-on-a-web-page-to-control-something-via-node-red/6289):
>
> I bought myself a book on jQuery and Ajax for Christmas. Here's a write-up on my first attempt at writing some jQuery that interfaces to Node-RED. The index.txt file must be renamed as index.html (as Discourse does not allow this type of file to be uploaded). It's a simple piece of html that links in jquery and sketch.js. The eight 'soft' buttons have unique 'id's. e.g. "turnREDon", "turnREDoff", etc... The index.html and sketch.js files can reside on any webpage on your local network. Th…

---

<div class="post-metadata">

### Author: ![briansone](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@briansone](https://discourse.nodered.org/u/briansone)
#### Post date: [11 October 2019 12:56 UTC](https://discourse.nodered.org/t/node-red-catch-webpage-click-event/16582/3 "2019-10-11T12:56:25Z")

</div>

Thanks for sharing Dave, it couldn't have been easier to get your scripts working!

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [11 October 2019 13:21 UTC](https://discourse.nodered.org/t/node-red-catch-webpage-click-event/16582/4 "2019-10-11T13:21:20Z")

</div>

Really glad to hear the scripts have been useful to someone.
