Skip to content

Instantly share code, notes, and snippets.

View briankung's full-sized avatar

Brian Kung briankung

  • Chicago
View GitHub Profile
// Yoink: https://www.javascripttutorial.net/web-apis/javascript-formdata/
const btn = document.querySelector('#submit-btn-id');
const form = document.querySelector('#my-form-id');
btn.addEventListener('click', (e) => {
// prevent the form from submitting
// or uncomment the debugger statment below for a breakpoint
// if needing to also send the data for testing
e.preventDefault();