I want to replace $('#divy a:lt(3)')
and add the variable instead of number $('#divy a:lt(count)')
, but it's not working.
var timerId,
count = 0;
function end_counter() {
$('#divy a:lt(3)').each(function () {
var $this = $(this);
$this.attr('target', '_blank');
$this.get(0).click(function () {
window.open(this);
return false;
});
});
count = 0;
}
$('button').click(function () {
count++;
clearTimeout(timerId);
timerId = setTimeout(end_counter, 700);
});