JSFiddle - React, Tailwind, and code Playground

by lomatek

HTML

<form id="f">
  <input id="t">
  <button id="b">Go</button>
</form>
<div id="r"></div>

JavaScript

$('#t').focus();
$('#f').submit(function () {
    var inInt = parseInt($('#t').val()).toString(16);
    $('#r').html(parseInt(inInt.slice(0, inInt.length - 4), 16) + '-' + parseInt(inInt.slice(inInt.length - 4), 16));
    return false;
})
parseInt(inInt.slice(0,2), 16), parseInt(inInt.slice(2), 16)