how about # # # $('.foo').click(function(){ var par = $(this).attr('name'); // do whatever you need with name attribution });
Thierry-32 wrote: > > > Hi, > > I am trying to remove every Javascript reference from my HTML data > (except the inclusion headers of course). > I would like some advice regarding event listeners when parameters > come into play. > > Here is the typical example: > For event handlers in HTML like: > # > I would have no problem replacing with the following HTML: > # > and Javascript code in separate file: > $(document).ready( > function() { > $("a.foo").click(foo()); > } > ) > > However, how would you proceed when parameters are to be passed to "foo > ()"? E.g: > # > # > # > > I was thinking of something like: > # > # > # > But how to bind the foo() function (with proper parameter) using > jQuery? > > Thanks for any recommendation/comment. > Thierry > > -- View this message in context: http://www.nabble.com/Using-jQuery-to-completely-separate-HTML-from-Javascript-tp24467775s27240p24507040.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.