res.text()
instead of res.json()
cause it returns the count as text instead of in jsonapp.use(cors('*'))
rightvar btn = document.getElementById('playLaugh');
var player = document.getElementById('laugh');
var counter = document.getElementById('counter')
btn.addEventListener('click', function(){
player.play();
axios.get('/increment.php').then(function(res){
counter.textContent = res.data;
});
});