1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
<script type="text/javascript">
<!--
registerEvent = function(on, ev, func, capture) {
if (window.addEventListener)
on.addEventListener(ev, func, capture);
else {
if (!on.funcsCounter) on.funcsCounter = 0;
on['func'+on.funcsCounter] = func;
on.funcsCounter++;
on.attachEvent("on"+ev, function() { for(var i=0; i<on.funcsCounter; i++) on['func'+i](); });
}
}
window.onload = function() {
monInput = document.createElement('input');
monInput.type = "text";
var monInputId = monInput.id = 'mat2';
monInput.value = 'Y';
document.body.appendChild(monInput);
registerEvent(document.getElementById(monInputId), 'focus', function() {this.value='';});
registerEvent(document.getElementById(monInputId), 'blur', function() {this.value=this.value.toUpperCase();});
}
// -->
</script> |
Partager