Только цифры
<textarea id = "#txt"></textarea>
<script type = "text/javascript">
var events = ["keydown", "keyup", "cut", "paste", "input", "change"];
function digits(){
this.value = this.value.replace(/[^\d]+/g, "");
}
var t = document.getElementById("#txt");
for(var i = 0; i < events.length; i ++){
t.addEventListener(events[i], digits, false);
}
</script>