JSFiddle - React, Tailwind, and code Playground

by tonytlwu

HTML

<form id="form">
  <p><input type="text" name="1" id="no-submit" /></p>
  <p><input type="text" name="2" /></p>
  <p><input type="text" name="3" /></p>
  <p><input type="submit" /></p>
</form>

JavaScript

$('#form').on('submit', function (e) {
	if (document.activeElement.id === 'no-submit') {
  	e.preventDefault();
  }	
});