看板 Web_Design 關於我們 聯絡資訊
我有個input area 如下 (類似聊天室的訊息輸入欄位) ----------------------------------- ----------------- | input type = "text" | | send button | ----------------------------------- ----------------- 如圖(雖然有點醜orz) 一般來說我想把訊息送出 會寫在send button的onclick function中 但是如果我想讓使用者在input area打完字後 直接按enter就可以有send message的動作 應該怎麼做呢? 有點類似.NET framework裡的form::acceptBtn 可是我找不到網頁版的寫法 >"< 先謝謝各位了~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.131.64
ybite:把那個Button的type設為submit 05/13 16:26
ybite:將Script的語法寫在<form onsubmit="..."> 05/13 16:26
kevinCosner:謝謝 XD 05/14 12:05