Okay. This might be a little bit difficult to explain. Let's just say I have three variables in JavaScript
window.seconds = 0;
window.minutes = 0;
window.hours = 0;
and also three anchor tags in HTML
<a id='seconds_plus' href=''>Increase seconds</a><br>
<a id='minutes_plus' href=''>Increase minutes</a><br>
<a id='hours_plus' href=''>Increase hours</a><br>
Each time a anchor is clicked, the integer of the variable will increase by 1. Now see, I am a lazy person and don't want to write 3 same .click() functions. That is why I came up with a single .click() function on which I have a problem on.
$("#hours_plus, #minutes_plus, #seconds_plus").click(function () {
var increase = $(this).attr("id").split("_");
increase[0]++; // <-----
});
Is there a way this could be possible to do?