By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

no alert?

P: 4
I have this code and it doesn't seem to alert the fact that I'm pressing a key (this should happen after I click Start). Why? :/

Expand|Select|Wrap|Line Numbers
  1. function dynamic_buttons() {
  2.     var start_button = document.getElementById('start');
  3.     var stop_button = document.getElementById('stop');
  4.     start_button.onclick = log_keypress;
  5.     stop_button.onclick = log_keypress;
  6.     }
  7.  
  8. function log_keypress() {
  9.     alert('click event happened'); 
  10.     }
And here's the "whole" code: code
Mar 18 '14 #1
Share this Question
Share on Google+
1 Reply


P: 4
done. i forgot calling it :) thank you
Mar 18 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.