// JavaScript Document
<!---限制輸入數字 開始--->
function onlynum(val){
  var newval = val.replace(/[^\d]/g,'');
  return newval;
}
<!---限制輸入數字 結束--->