»»» technology + aesthetics «««

Dynamic Events in Javascript

WITHOUT PARAMETERS
Element.<<EVENT>> = <<FUNCTION-NAME>>
eg: document.onLoad = showShadow;

WITH PARAMETERS
Element.<<EVENT>> = function(){ <<FUNCTIONNAME>>(<<PARAM LIST>>)};
eg:  element.onClick = function(){ showAlert(param1,param2) }; // This is a reference to a function

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Feedback

# re: Dynamic Events in Javascript

HEy, in the second case do you know how to pass value of the variable(e.g. value of param1) rather then variable itself(param1)? 9/24/2009 10:33 AM | barmaley

# re: Dynamic Events in Javascript

Thanks! good stuff... 8/10/2010 7:59 PM | Guna

# re: Dynamic Events in Javascript

ok

2/2/2011 1:35 AM | sundarraj