I would suggest using a class to identify these buttons (ex:
editimage). Then you can easily find them and get their number:
$('.editimage').click(function () {
var n = this.id.match(/\d/);
loadPopup('Image' + n);
});
On Sat, Jan 16, 2010 at 1:44 PM, Peter wrote:
> I have a load of buttons w
I have a load of buttons with almost similar names but with a number
identifying them:
id=editimage1
id=editimage2
id=editimage3
id=editimage4
etc.
In the onclick event of these buttons I want to do something:
$("#editimage1").click(function() {
loadPopup('Image1');
});