作者powerjj (ya)
看板Ajax
標題[問題] 請問一個在JavaScript中button action的問題...
時間Mon Feb 14 17:47:07 2011
不知是否因為我使用NETUI的關係
<netui:button type="submit" value="=" action="calculate" tagId="eqButton"/>
這是我button的html碼
我參考網路上的寫法使用在JavaScript中寫成
document.getElementById("eqButton").action="calculate";
document.getElementById("eqButton").submit();
結果應該是沒有執行action...
但是document.getElementById("eqButton")確實有抓到,
那就是後面的寫法有問題了?@@
可否請高手指點一下,感謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.33.8.54
1F:→ powerjj:抱歉,我不會回水球,另外我上傳網頁之位置在另一台電腦,現 02/14 21:50
2F:→ powerjj:在可能恐怕拿不太到... 02/14 21:50
3F:→ powerjj:我也有約略看過原始碼了,的確呼叫action的方式不是一般在 02/14 21:56
4F:→ powerjj:TAG中呼叫的方式... 02/14 21:56
5F:→ powerjj:恩,那我明天拿到了再看看 02/14 22:05
6F:→ mesak:.setAttribute('action','calculate'); 02/18 02:26