Extension - Add button to chat container

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) but they don’t send text.
Thank you.

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.

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