JSFiddle - React, Tailwind, and code Playground

by John Doe

HTML

<p>Type 'correct' to validate.</p>
<form action="javascript:alert( 'success!' );">
  <div>
    <input type="text">
    <input type="submit">
  </div>
</form>
<span></span>

CSS

p {
    margin: 0;
    color: blue;
  }
  div,p {
    margin-left: 10px;
  }
  span {
    color: red;
  }

JavaScript

$( "form" ).submit(function( event ) {
 
var n =  $( "input" ).val();
alert(n);
  }
 
 // $( "span" ).text( "Not valid!" ).show().fadeOut( 1000 );
//  event.preventDefault();
});

/*
"use strict";
var n = $("#n").val();
$( "#btn" ).click(function() {
n.submit();

});
*/
//var n = $("#n").val();
//$("#result").html(n)


/*n = n.charCodeAt(0).toString(16);*/