看板 Ajax 關於我們 聯絡資訊
各位先進好 不好意思來問個蠢問題 小弟目前使用jquery 創建 一個form $(function(){ output="<form ><input type='submit' id='newuser' value='新增' /></form>"; $('#out').html(output); $('#out form').submit(function(e){ alert('newuser'); }).trigger('submit'); }); 但是無法確實跳出 newuser 還請各位前賢指教 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.130.116.41
qwer820404:給form id 然後 01/10 21:50
qwer820404:$(form的id).submit(); 01/10 21:51
qwer820404:trigger的用法我不是很熟 但感覺不能直接call event吧 01/10 21:59
Nonegrame:我測沒問題耶。 http://ppt.cc/iETS 01/11 20:09
q26766:移… 範例是我簡短打的 沒想到是可以 01/13 10:14
TonyQ:你打的跟 qwer 打的意思是等價的... 01/13 19:07
pttnews:IE可能不行喔 01/17 08:54