JSFiddle - React, Tailwind, and code Playground

by nilloc

HTML

<input type="text" id="tester" value="asdf.1234./">

JavaScript

var $input = $('#tester');
$input.bind('input propertychange', $.proxy(function(){
    var fixedString = $input.attr('value').replace(/\./g, '');
    setTimeout($.proxy(function(){
        console.log('setting', $input, 'value to:', fixedString);
        $input.attr('value', fixedString);
    }, this), 1000);
    //$input.attr('value', fixedString);
}, this));

$input.bind('blur', $.proxy(function(){
    console.log('blurred');
    $input.attr('value', 'ner');
}, this));