I gave a function, on clicking it am getting image id, using this I have to change the image using javascript.
The code is as follows
$('img').live('click', function () {
alert(this.id);
});
the outputs are as follows like_0,like_1...... and unlike_0,unlike_1.........
But depending on the output I have to change image
$("#like_").click(function () {
$("#tipid").val(1);
$("#like_").attr("src", "images/ic_like_select.png");
$("#unlike_").attr("src", "images/ic_unlike_unselect.png");
});
$("#unlike_").click(function () {
$("#tipid").val(0);
$("#like_").attr("src", "images/ic_like_unselect.png");
$("#unlike_").attr("src", "images/ic_unlike_select.png");
});
My problem is I was not known how to change. Can someone help me thanks.