using javascript is much better than putting the functions inline in the HTML. Its alot cleaner, and makes it alot easier to manage.
On 6/12/07, james_027 <[EMAIL PROTECTED]> wrote:
Hi, I have think of that solution, and but my concern is I have read somewhere that says, why change the dom if you like $ ("a").click(alert(this.id);return false); if you could code <a href:"javascript:alert(this.id); return false;"> Should it be concern of this? Thanks james On Jun 12, 11:28 am, "Ⓙⓐⓚⓔ" <[EMAIL PROTECTED]> wrote: > 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 > > -- > Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ