# Can't access element defined in plugin outlet with DOM interface

**URL:** <https://meta.discourse.org/t/cant-access-element-defined-in-plugin-outlet-with-dom-interface/185213>\
**Category:** Development\
**Created:** [April 2, 2021, 6:44am UTC](https://meta.discourse.org/t/cant-access-element-defined-in-plugin-outlet-with-dom-interface/185213 "2021-04-02T06:44:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![MrDavis97](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mrdavis97/32/206391_2.png) [@MrDavis97](https://meta.discourse.org/u/MrDavis97)\
**Post date:** [April 2, 2021, 6:44am UTC](https://meta.discourse.org/t/cant-access-element-defined-in-plugin-outlet-with-dom-interface/185213/1 "2021-04-02T06:44:09Z")

</div>

I used the following plug-in outlet to make a button below the header.

```plaintext
<script type="text/x-handlebars" data-template-name="/connectors/below-site-header/vic-button">
    <a id="vic-button" href="http://mathbymiles.com/new-topic?title=&body=&category=uncategorized&tags=" class="btn btn-default">
        <span class="d-button-label">
            ask a question
        </span>
    </a>
</script>

```

It works just fine. However, now I want to access it with JavaScript to manipulate it, but when I try to get the element based on the `id` `vic-button`, the console just returns `null`.

So when I do

```plaintext
<script type="text/discourse-plugin" version="0.8">
    const button = document.getElementById('vic-button');
    console.log(button);
</script>

```

I get `null` as the output. Any ideas?

---

_[View the full topic](https://meta.discourse.org/t/cant-access-element-defined-in-plugin-outlet-with-dom-interface/185213)._
