<html>
<head>
<title>Value Starts With Tutti Frutti - RJM Programming - December, 2023</title>
<style>

textarea {
background-color: yellow;
text-shadow: -1px 1px 1px #952dff;
}

textarea[title^='a'] {
background-color: lightgreen;
}

textarea[title^='ab'] {
background-color: lightblue;
}


</style>
<script type=text/javascript>
var colbit='01234567890abcdef';

function tuttifrutti(evt) {
var char = evt.which || evt.keyCode;
if (!evt.shiftKey && String.fromCharCode(char) >= 'A' && String.fromCharCode(char) <= 'Z') {
char+=('a'.charCodeAt(0) - 'A'.charCodeAt(0));
}
var sw=document.getElementById('myta').value+String.fromCharCode(char).replace(/\'/g,'');
while (sw.indexOf(String.fromCharCode(10)) != -1) {
sw=sw.replace(String.fromCharCode(10),'');
}
var colis='';
for (var icol=0; icol<6; icol++) {
colis+='' + colbit.substring(Math.max(1,Math.floor(Math.random() * colbit.length))).substring(0,1);
}
document.getElementById('dstyle').innerHTML+="<style> textarea[title^='" + sw + "'] { background-color: #" + colis + "; } </style>";
return true;
}

function unwell(tao) {
setTimeout(function(){ document.getElementById('myta').blur(); }, 20);
return true;
}

function well(tao) {
//document.getElementById('iaway').focus();
document.getElementById('myta').title=document.getElementById('myta').value.replace(/\'/g,'');
while (document.getElementById('myta').title.indexOf(String.fromCharCode(10)) != -1) {
document.getElementById('myta').title=document.getElementById('myta').title.replace(String.fromCharCode(10),'');
}
setTimeout(function(){ document.getElementById('myta').focus(); }, 20);
}


</script>
</head>
<body>
<h1>Value Starts With Tutti Frutti</h1>
<h3>RJM Programming - December, 2023</h3>

<textarea title='' cols=80 rows=20 onkeydown='return tuttifrutti(event);' onkeypress='return unwell(this);' onchange=well(this); onblur=well(this); id=myta></textarea>
<input type=text style="position:absolute;top:-900px;left:-800px;" value="" id=iaway></input>

<div id=dstyle></div>
</body>
</html>