# domain.com/signup をクリックしたすべてのユーザーを別のページにリダイレクトする

**URL:** <https://meta.discourse.org/t/redirect-all-users-who-click-on-domain-com-signup-to-a-different-page/80532>\
**Category:** Development\
**Created:** [2018 年 2 月 14 日午後 12:14 UTC](https://meta.discourse.org/t/redirect-all-users-who-click-on-domain-com-signup-to-a-different-page/80532 "2018-02-14T12:14:23Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![nadermx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nadermx/32/67585_2.png) [@nadermx](https://meta.discourse.org/u/nadermx)\
**Post date:** [2018 年 2 月 15 日午後 1:52 UTC](https://meta.discourse.org/t/redirect-all-users-who-click-on-domain-com-signup-to-a-different-page/80532/12 "2018-02-15T13:52:47Z")

</div>

Alright, I’m trying to edit the theme instead and have put this javascript in my `</head>` section

```
<script>
    document.getElementsByClassName(".sign-up-button").onclick = function () {
        console.log('this should print');
    };
</script>

```

But when ever I click it it does not show in the console.

I’ve also tried variations, it does show the element but no actions of the js are working on it such as

```
<script>
    var thingy = document.getElementsByClassName("sign-up-button");
    console.log(thingy);
    thingy.onclick ="return false;"
    thingy.onclick = function() {
        window.location.href = "https://join.example.com";
    };
    console.log(thingy);
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/redirect-all-users-who-click-on-domain-com-signup-to-a-different-page/80532)._
