this is for objects , that is not, use that as the name of your parameter. var myEvent = function(that){ alert(that.id <http://this.id/>); }
But in jQuery... you drop all those bogus hrefs for place holders href="#" and code $("a").click(alert(this.id);return false); On 6/11/07, james_027 <[EMAIL PROTECTED]> wrote:
Hi, I have a <a> calling a javascript function, but there will be several <a> calling the same javascript function, and I want to know which <a> calls it, I have assign different id attribute for each <a>, then I don't know how to proceed ... here is my html: <a id="one" href="javascript:myEvent(this)">Caller One</> <a id="two" href="javascript:myEvent(this)">Caller Two</> <a id="three" href="javascript:myEvent(this)">Caller Three</> here is my javascript var myEvent = function(this){ alert(this.id); } Well, this doesn't work for me, I hope you got what I mean. Thanks in advance. james
-- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ