JSFiddle - React, Tailwind, and code Playground

by Lars Holm Jensen

HTML

<form id="form">

<input type="text" name="tall1" id="tall1" placeholder="Spot 1"/>

  <input type="text" name="tall2" id="tall2" placeholder="Spot 2"/>

  <input type="text" name="tall3" id="tall3" placeholder="Spot 3"/>

  <p id="tall1p"> </p>

  <p id="tall2p"> </p>

  <p id="tall3p"> </p>

  <button type="submit">Send</button>
</form>

<p id="output"></p>

JavaScript

console.log('hello, developer!');
 const form = document.getElementById('form');
 form.addEventListener('submit', function(e) {
 	const tall1 = document.getElementById('tall1').value;
  const tall2 = document.getElementById('tall2').value;
  const tall3 = document.getElementById('tall3').value;
  console.log(tall1);
  e.returnValue = false; //Stop actually submitting
})