How can I do this:
I have a CHECKMARK image wherein when I click that image, it will be replaced with a LOCK image. How can I do this in jquery and php?
How can I do this:
I have a CHECKMARK image wherein when I click that image, it will be replaced with a LOCK image. How can I do this in jquery and php?
Could use a bit more context, but something like this:
$(function ()
{
$('#checkmarkImage').click(function ()
{
$(this).attr('src', '/path/to/lock/image.jpg');
});
});
$('img.checkmark').toggle(function() {
$(this).attr('src', 'lock.png');
}, function() {
$(this).attr('src', 'checkmark.png');
});
All img
tags with the checkmark
class will now have the toggle functionality:
<img src="checkmark.png" class="checkmark"/>