JSFiddle - React, Tailwind, and code Playground
by mehmetatas
HTML
<form method="post">
<input type="submit" value="Submit" />
<input type="button" value="Set Text" onclick="setDefaultText();" />
<input type="button" value="Add TextBox" onclick="addTextBox();" />
<br /><br />
<textarea id="txtArea" rows="5" cols="20">Initial test text</textarea>
<br /><br />
<input id="txtInput" type="text" value="value" />
</form>
JavaScript
$(function() {
$("input[type=text],textarea").live("input focus blur propertychange keyup keypress paste load", function(event) {
$(this).val($(this).val().replace(/i/g, '\u0130').toUpperCase());
});
$("input[type=text],textarea").each(function() {
$(this).val($(this).val().replace(/i/g, '\u0130').toUpperCase());
});
$("form:first").submit(function() {
$("input[type=text],textarea").each(function() {
this.focus();
});
});
});
function addTextBox() {
var txt = document.createElement("INPUT");
txt.type = "text";
document.body.appendChild(txt);
}
function setDefaultText() {
$("input[type=text],textarea").val("öçşiüğıi");
}