站內搜尋

Tuesday, November 6, 2012

[JavaScript] 簡單的改變按鈕文字功能


直接看程式碼:
<input id="chk" type="button" value="開啟" onclick="if(document.getElementById('chk').value=='開啟'){document.getElementById('chk').value='關閉'}else{document.getElementById('chk').value='開啟';}" />

實作:

No comments:

Post a Comment