there is a much simpiler way
<script>
$(document).ready(function()
{
$("img.ImgButtonClassName").click(function()
{
var buttonid = $(this).attr("buttonid");
//do other stuff here
});
});
</script>
and in each of the img tags put buttonid="someidnumber" and a custom named css class
so
<img src="trash.jpg" class="ImgButtonClassName" buttonid="someidnumber">
No need for the anchor tags or the onclick events as jquery takes care of setting up event handlers.
----------------------
Yahoo answers is cutting off part ofthe script
the .click thing is supposed to be .click(function()
<script>
$(document).ready(function()
{
$("img.ImgButtonClassName").click(function()
{
var buttonid = $(this).attr("buttonid");
//do other stuff here
});
});
</script>
and in each of the img tags put buttonid="someidnumber" and a custom named css class
so
<img src="trash.jpg" class="ImgButtonClassName" buttonid="someidnumber">
No need for the anchor tags or the onclick events as jquery takes care of setting up event handlers.
----------------------
Yahoo answers is cutting off part ofthe script
the .click thing is supposed to be .click(function()