<body ng-app="starter">
<ion-pane>
<ion-header-bar class="bar-dark">
<h1 class="title">LifeApp</h1>
</ion-header-bar>
<ion-content>
<center><div class="card" id="life"><h3>20</h3></div></center>
<div class="button-bar">
<a class="button" onclick="incdec('-1')">-1</a><!-----------this function call----->
<a class="button">+1</a>
</div>
<br />
<div class="button-bar">
<a class="button">-5</a>
<a class="button">+5</a>
</div>
<br />
<div class="button-bar">
<a class="button">Roll Dice</a>
<a class="button">0</a>
</div>
<br />
<center><a class="button">Reset</a></center>
</ion-content>
</ion-pane>
<script>
function = incdec(plusminus){
alert('running');
plusminus = parseInt(plusminus);
currentlife = document.getElementById("life").innerHTML + plusminus;
document.getElementById("life").innerHTML = currentlife;
}
</script>
I was trying to copy a video on youtube and while doing that the function incdec() is not getting called ..i tried everything but nothing seems to work

function = incdec(plusminus)?=? Is that a typo?function = incdec(plusminus)is a syntax error. Hence the question whether=is in your actual code or if it's just a typo in the question. Learn how to debug JavaScript. I also recommend to change the call toincdec(-1)and remove theplusminus = parseInt(plusminus);part. If you want a number then just pass a number.