Re: [問題] 在textbox裡預設當天的日期

看板Web_Design作者 (sss)時間18年前 (2008/01/23 02:10), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/4 (看更多)
※ 引述《ksl (只動手指的阿宅)》之銘言: : 各位大大好,我想用frontpage寫出在某個textbox裡預設當天的日期時間 : 看了很多用javascript寫的取出當日時間的方法 : 但有辦法將這個值放入textbox裡嗎? : 不好意思,如果問了蠢問題敬請見諒 <(_ _)> <script language="javascript"> function dateInTextbox() { var now = new Date(); document.getElementById('TEXTBOX').value = now.toLocaleString(); //這邊看你要填什麼格式的日期 //可以自己用 getDate getHours ... } </script> <body onload="dateInTextbox()"> <input name="TEXTBOX" type="text" id="TEXTBOX" value="" /> </body> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.168.30.203
文章代碼(AID): #17bZ6dZc (Web_Design)
討論串 (同標題文章)
文章代碼(AID): #17bZ6dZc (Web_Design)