Guest User

Untitled

a guest
Jun 24th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function createButton() {
  2. var a = document.createElement('a');
  3. var css = document.createElement('style');
  4. css.type = 'text/css';
  5. css.innerHTML = '#prt { position:absolute; right:3em; top: 6em; font-family: Arial,Helvetica,sans-serif; font-weight:bold; font-size:125%; background: #777777 none repeat scroll 0 0; color: white; padding: 6px 12px;}'
  6. a.href = '#';
  7. a.innerHTML = 'Print Topic';
  8. a.id = 'prt';
  9. a.onclick = getTopic; // DOESN'T WORK
  10. document.body.insertBefore(a, document.body.lastChild);
  11. document.body.appendChild(css);
  12. }
  13.  
  14. a.setAttribute('onclick', function() { alert("hey"); });
  15.  
  16. element.addEventListener ('click', myClickHandler, false);
  17.  
  18. a.onclick = function(){
  19. getTopic();
  20. }
Add Comment
Please, Sign In to add comment