Noob Question Passing Variables / Arguments to a Function

Noob Question Passing Variables / Arguments to a Function

Hello,
I am sorry it has come to asking real folks about the one thing I just cannot seem to find a clear answer for when using jQuery.

When I generate links on a page how to I use the contained arguments with a jQuery function. I dont know how I am missing it. I have been through a heap of tutorials but nothing seems to cover it specifically.

For example:
In the good old days I used to just have a link with an onclick what would send things off to the appropriate function: 
  1. <a href="#" onClick="myfunction('log1.txt', 'green');">CLICK</a>
  2. <script>
  3. function myfunction(logname, colour)
  4. {
  5. // something here
  6. }
  7. </script>

From all the bits and pieces I have tried to learn about jQuery all this info is directly in the function but nothing ever seems to cover how to pass these things in if required. SO from what I have gathered to do the same thing as above I would use:

  1. <a href="#" id="loglink">CLICK</a>
  2. <script>
  3. $(document).ready(function() {
  4.       $('.loglink').click(function() {
  5.       // something here with 'log1.txt', 'green'
  6.       });
  7. });
  8. </script>

but this isn't anywhere near as useful because I basically want to have the arguments in the link rather than already in the function.

I know I am missing something completely (I must be) could someone please spend a moment and clear it up  once and for all....

Thankyou very much!