If i have elements such as this
Do not create markup that contains elements with duplicate IDs. This will break things, and you will be mauled by a velociraptor faster than you can say "goto".
Use classes instead:
then...
$(document).ready(function() {
$('.myEle').live('mouseup', function () {
$('#images').attr("src", myEle.getNumber() + ".jpg");
});
});
"How do i know which image is pressed?"
Use the this keyword:
$(document).ready(function() {
$('.myEle').live('mouseup', function () {
$('#images').attr("src", $(this).attr('src'));
});
});
...I think that's what you're looking for.
