JSFiddle - React, Tailwind, and code Playground
by fakhruddin
HTML
<input type="test" class="name" />
JavaScript
$('.name').keyup(function() {
var $th = $(this);
$th.val( $th.val().replace(/[^a-zA-Z' ]+( [A-Za-z' ]+)*$/g, function(str) { return ''; } ) );
});