Need Idea which I don't know how to describe

Need Idea which I don't know how to describe

Hi,

I think i have a simple problem, I want to do something like that:

  1. <script type="text/javascript">
  2. $(function()
  3.     {
  4. $("#kk[x]").click(function(event)
  5.         {
  6. event.preventDefault();
  7. alert(x);
  8. });
  9. });
  10. </script>
  11. <a href="#" id="kk[1]">First</a>
  12. <a href="#" id="kk[2]">Second</a>

I want to make it to show me "1" when i click in First and "2" when i click in Second. Is it possible? I try on several diffrent ways but nothing worked as i would like it to. Sorry for my english, and i don't know if described it well enough to understand but i'll be appreacitive for every help here on forum or even though links to proper documentation or even examples. Thanks!

Update:

I done it that way:

  1. <html>
  2. <head>
  3. <title>As dsd</title>
  4. <link type="text/css" href="css/black-tie/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
  5.     <!--<link type="text/css" href="css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />-->   
  6.     <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
  7.     <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
  8.  <style type="text/css">
  9. .selected
  10. {
  11. color:green;
  12. }
  13. </style>
  14. <script type="text/javascript">
  15. $(function()
  16.     {
  17. var tt;
  18. $("a#kk").click(function(event)
  19.         {
  20. var index = $("a#kk").index(this);
  21. var alf=["a", "b", "c", "d", "e", "f", "g", "h"];
  22. alert($("a#kk").index(this));
  23. $("a#kk." + alf[index]).addClass("selected");
  24.         });
  25.             });
  26. </script>
  27. </head>
  28. <body>
  29. <a href="#" id="kk" class="a">First</a>
  30. <a href="#" id="kk" class="b">Second</a>
  31. <a href="#" id="kk" class="c">Third</a>
  32. <a href="#" id="kk" class="d">Fourth</a>
  33. </body></html>
but i thin this instance sucks ;/ what do you think?