[問題] 按button後將值連續寫入text中
<input type="button" value="1"
onclick="document.getElementById('n1').value='2010-08-1'">
<input type="button" value="2"
onclick="document.getElementById('n1').value='2010-08-2'">
<input type="text" id="n1" name="text">
我希望能在按了button1後再按button2,
text會顯示"2010-08-1, 2010-08-2"這樣連續紀錄下去的結果
但是我這樣寫按完button1後再按button2
text只會顯示"2010-08-2"的結果
要怎麼把按過的button後想顯示的值串接起來到text中呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.125.41.241
→
08/20 16:50, , 1F
08/20 16:50, 1F
→
08/20 16:51, , 2F
08/20 16:51, 2F
→
08/20 16:51, , 3F
08/20 16:51, 3F
→
08/20 16:57, , 4F
08/20 16:57, 4F
→
08/20 17:58, , 5F
08/20 17:58, 5F