JSFiddle - React, Tailwind, and code Playground
HTML
<form id="form_710370" class="appnitro" method="post" target="iframe1" action="convert.php">
<p id="inputs">
<span><input id="Website" type="url"name="url1" data-validation="url" ></span>
<input id="saveForm" class="button_text" type="submit" name="submit" value="View My Mobile Site" />
</p>
</form>
<div id="viewer">Shouldn't see this</div>
JavaScript
$(document).ready(function () {
$("#saveForm").click(function () {
$.cookie('myCookie', $("#Website").val(), {
expires: 365,
path: '/'
});
});
$("#Website").val("http://prepopulated/value");
});
$(function () {
$('#Website').on('keyup blur paste', function() {
var self = this;
setTimeout(function() {
var str = $(self).val();
$("#viewer").text(str.replace(/^http\:\/\//, ''));
}, 0)
})
$("#viewer").text($('#Website').val().replace(/^http\:\/\//, ''));
});