的寬度,我有基本的JavaScript提示()函數調整輸入字段
function askUser() {
if(confirm('Are you sure you want to add this item?')) {
if(prompt('How many of this would you like to order?', '')) {
......
我想達到什麼是ajust輸入欄的寬度,也許30像素時的提示信息在屏幕上彈出?用戶只需要輸入一個數值或2個整數的數量。
而且我該如何檢查輸入的值是否是整數?如果不是,我想提醒用戶他輸入了一個無效的值。
謝謝。
使用對話,而不是提示 – mplungjan