I'm trying to change the background color of an link when the user touches/taps on a mobile, although the following code works, sometimes the link remains black and doesn't change back to white when you release, is there a better way of coding it?
$('#test').bind('touchstart', function() {
$(this).css('background-color', 'black');
});
$('#test').bind('touchend', function() {
$(this).css('background-color', 'white');
});
Thanks!