You did not set the left property of the .popup div
.popup {
width: 200px;
height: 50px;
border: 1px dashed #000;
position: absolute;
top: 100px;
left:0px;
}
To enhance your script, consider the following:
$(document).ready(function () {
var left = parseInt($(".popup").css('left'));
var refreshIntervalId;
$(".left").on('mousedown', function () {
refreshIntervalId = setInterval(function () {
$('#counter').html(parseInt($('#counter').html()) + 1);
left += 5;
$(".popup").css({"left": left})
}, 10);
})
$(".left").on('mouseup', function () {
clearInterval(refreshIntervalId);
})
$(".right").on('mousedown', function () {
refreshIntervalId = setInterval(function () {
$('#counter').html(parseInt($('#counter').html()) - 1);
left -= 5;
$(".popup").css({"left": left});
}, 10);
})
$(".right").on('mouseup', function () {
clearInterval(refreshIntervalId);
})
});