so to summarize what the two posters above so eloquently stated:
There is still the question though, what are you ultimately trying to accomplish here? Getting the ID from an element in jQuery is super simple, but what are you doing with this ID exactly? What is the end result you are hoping for?
Here a couple of links with some good examples for using jQuery to make the AJAX calls. The Nettuts link has some good information about passing params to the external file.
so, without you knowing how PHP is used, it's a bit difficult.. but maybe this will help...
var textBox = document.getElementById("myText");
var myString = textBox.value;
if (myString.length.replace(" ","") < 1)
alert ("You need to put something in the box!!!");
//try to create an AJAX object in the browser....
AJAXObj = (window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"));
alert ("Your browser does not support AJAX calls. Sorry :-/");
//set a callback function, for when we get a response from the server (the PHP page).
if (xmlhttp.readyState==4 && xmlhttp.status==200)
//try to open a connection: open(METHOD, URL, ASYNC) -- since we are doing a "GET" we are going to add
//all of our params to the "URL" by adding a "?" and then name=value pairs.
AJAXObj.open("GET", "myAJAX.php?string=" + myString, true);
AJAXObj.send(); //sends our request.
<input type="text" id="myText" />
<input type="button" onclick="myAJAX();" />
save the above as example.html
next page is going to be our PHP page:
Move both to your server. Open example.html. You now have a working AJAX call.
So lets talk about what you want to do. You wanted to send the ID of the item clicked to the PHP.
I don't think I can be any more clear than this...