JSFiddle - React, Tailwind, and code Playground
by sapegin
HTML
<input id="field">
JavaScript
$(function() {
if (!window.localStorage) return;
var value = window.localStorage.getItem('value');
if (value) $('#field').val(value);
});
$('#field').keyup(function() {
if (!window.localStorage) return;
window.localStorage.setItem('value', $('#field').val());
});
$(window).bind('storage', function(e) {
var event = e.originalEvent;
if (event.key == 'value') {
$('#field').val(event.newValue);
}
});