Skip to content

Instantly share code, notes, and snippets.

@AmaanC
Created November 8, 2012 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmaanC/4040916 to your computer and use it in GitHub Desktop.
Save AmaanC/4040916 to your computer and use it in GitHub Desktop.
Google button on SO chat
var button = document.createElement('button');
button.className = 'button';
button.appendChild(document.createTextNode('Google'));
button.addEventListener('click', function (){
window.open('https://www.google.com/search?q=' + document.getElementById('input').value);
}, false);
document.getElementById('sayit-button').insertAdjacentElement('afterend', button);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment