[Javascript] item.onclick = "alert('foo');";

Anthony Ettinger apwebdesign at yahoo.com
Mon Nov 7 09:51:20 CST 2005


nevermind, i figured out that it can only be a
function reference, not a call.

item.onclick = foo;



--- Anthony Ettinger <apwebdesign at yahoo.com> wrote:

> this doesn't seem to work:
> 
> var item = document.getElementById('foo');
> item.onclick = "alert('foo');";
> 
>
http://developer.mozilla.org/en/docs/DOM:element.onclick
> 
> Anthony Ettinger
> ph: (408) 656-2473
> web: http://www.apwebdesign.com
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 


Anthony Ettinger
ph: (408) 656-2473
web: http://www.apwebdesign.com



More information about the Javascript mailing list