how to pass the id of a row link to a jquery , in order to use ajax?

how to pass the id of an edit or delete link via jquery in order to use ajax and php ?
here’s my code at the front-end which displays the links

foreach($  cat->getCategories() as $  key => $  val){
        echo $  val."&nbsp;&nbsp;&nbsp;<a id='editcat' href=edit.php?id=".$  key.">Edit</a>&nbsp;&nbsp;&nbsp;<a id='deletecat' href=delete.php?id=".$  key.">Delete</a><br />";
}

now how to pass those id’s to the jquery ?

   $  ('#editcat').click(function(){

   });

   $  ('#deletecat').click(function(){

   });

newest questions tagged jquery – Stack Overflow

About Admin