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

Flavio Gomes flavio at economisa.com.br
Mon Nov 7 06:38:15 CST 2005


Funny same here.. couldn't catch why didnt' worked..
But this worked:

=========================
item.onclick = function () { alert('foo'); };
=========================



Anthony Ettinger escreveu:

>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
>  
>
--
Flavio Gomes
flavio at economisa.com.br



More information about the Javascript mailing list