Newbie variable question
Newbie variable question
Howdy all,
I'm a self confessed newbie to jQuery and the world of javascript and for the life of me I can't find why I keep getting a 'Cannot assign to a function result' error.
Basically, I have 2 <a> tags that act like buttons with a <span> tag between them that displays a number. When the user clicks on the right arrow I want the number that is displayed in the <span> tag to increment by one, and when they click on the right arrow I want it go back one number. Sounds simple enough, but apparently not to a newbie. I need to rotate between the number 1 & 50 (both forwards and backwards), so if they are on 1 and click back one, it should display 49. I'll be developing this script further to pull in ajax content based on the number displayed but one step at a time
Thanks in advance btw....
Here's what I've got so far.....
- $(document).ready(function () {
var CurrentCount = $('#Top50Count').html()
var Increment = 1
var NextCount = parseInt(CurrentCount) + parseInt(Increment)
var PreviousCount = parseInt(CurrentCount) - parseInt(Increment)
$('#Top50NavNext').click(function (e) {
$('#Top50Count').html() = NextCount;
e.preventDefault();
}
);
}
);