代码:
<input type="text" class="txt" name="qty" value="" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" />