Skip to content

Instantly share code, notes, and snippets.

View iamphoenix310's full-sized avatar

Pankaj Sharma iamphoenix310

  • Alias Entertainment INC
  • Ludhiana, Punjab, India
View GitHub Profile
@aerrity
aerrity / client.js
Last active March 20, 2024 17:34
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');