assign function to each matched element
Hi,
I have a lot of <a> elements on my page, now i want to assign to each of them a function to hide all the elements or in my case, preventDefault();
all my a elements look like this:
-
<a href="edit.php?edit=188" class="editB">Edit</a>
what i'm trying to get:
that the <a> does not go to the edit.php document but call a ajax request and display in a dialog or popup.
-
$("a").each(function() {
$("a").click(function(event) {
//$("div#hidden").load($(this).attr('href')).dialog();
event.preventDefault();
return false;
});
});
can anyone help me? i'm looking for the solution for 2 days on google but cant find it.
Cheers,
DirkJan Heinen[/code]