I am trying to make the text change through the buttons increment and decrement. I can't seem to find out why it does not work. Here's the code.
<body>
<script type="text/javascript">
var word = ["Getting lazy", "Shannon", "Letogasm", "fleek"];
var explanation = ["Getting lazy is the act of just laying on the ground after being
slammed or a hard fall.Most commonly used amongst skaters, bmx riders, and other extreme
sports.
", "
The coolest person in the world.
", "
Word used by Echelon and any other
Jared Leto fan to describe the feeling of(sexual) pleasure / happiness associated with
watching a Jared Leto / 30 Second to Mars Music Video or Movie.In other words, a Jared Leto
induced Orgasm.
", "
on point "];
function inc() {
var i = i++;
return i;
}
function dec() {
var i = i++;
return i;
}
var decos = document.getElementById('deco');
decos.addEventListener('click', inc);
var incos = document.getElementById('inco');
incos.addEventListener('click', dec);
document.getElementById('the-h').innerHTML = 'word[i]';
document.getElementById('the-p').innerHTML = 'explanation[i]';
</script>
<h1 id="the-h"></h1>
<p id="the-p"></p>
<input type="button" id="deco"><input type="button" id="inco">
</body>