# Extension - Add button to chat container

**URL:** <https://staging-discuss.dev.twitch.com/t/extension-add-button-to-chat-container/8155>\
**Category:** Help / Off-topic\
**Created:** [November 16, 2016, 1:17pm UTC](https://staging-discuss.dev.twitch.com/t/extension-add-button-to-chat-container/8155 "2016-11-16T13:17:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piotr2114](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@piotr2114](https://staging-discuss.dev.twitch.com/u/piotr2114)\
**Post date:** [November 16, 2016, 1:17pm UTC](https://staging-discuss.dev.twitch.com/t/extension-add-button-to-chat-container/8155/1 "2016-11-16T13:17:00Z")

</div>

Hi im creating an extension to chrome and i have a little problem. Im want to add button that sends text to textarea.  
var c = document.createElement(‘c’);  
c.type = ‘button’;  
c.className = ‘button button–icon-only float-left’;  
c.title = ‘Text’;  
c.innerHTML = ‘\<img src=’/uploads/default/original/2X/2/25c0a2f26e88a76ae81165f8919512ff0ad4fae6.png’;\>’;

```
setInterval(function() 
{
var container = document.querySelector('.chat-buttons-container');	
container.appendChild(c);
}, 1000);
c.onlick = taFunkcja();

function taFunkcja(){
var t = document.createTextNode("Example Text");
c.appendChild(t);
document.getElementById("ember2386").appendChild(c);

```

};  
I have my button on chat (scr: [http://scr.hu/0jvt/9hqz8](http://scr.hu/0jvt/9hqz8)) but they don’t send text.  
Thank you.

---

<div class="post-metadata">

**Author:** ![DallasNChains](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dallasnchains/32/1608_2.png) [@DallasNChains](https://staging-discuss.dev.twitch.com/u/DallasNChains)\
**Post date:** [November 16, 2016, 4:30pm UTC](https://staging-discuss.dev.twitch.com/t/extension-add-button-to-chat-container/8155/2 "2016-11-16T16:30:19Z")

</div>

What’s the use case for this? Your current code is just appending text to the DOM in your browser over and over with `setInterval`. It isn’t taking any action to send to chat.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [November 26, 2016, 4:30pm UTC](https://staging-discuss.dev.twitch.com/t/extension-add-button-to-chat-container/8155/3 "2016-11-26T16:30:18Z")

</div>

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