I have this jQuery which works fine
$('li[id^='shop_id']').click( function () { alert('I clicked on id ??'); });
The above will work if any list element with an id beginging with ‘shop_id’ is clicked (i.e ‘shop_id_1’, ‘shop_id_2’, etc). The problem is that I don’t know how to find out exactly which id was clicked. I need to know as I need to set the visability of other elements depending on which id was clicked.
Any ideas ?
Thanks
The ‘this’ variable will help you out here: