看板 Ajax 關於我們 聯絡資訊
function setDateText(sMonth,sDate,sYear) { var x = $('#i1'); var y = $(this); if ( x.is(y)) { $('#i1').val(sMonth + "/" + sDate + "/" + sYear); } else{ $('#i2').val(sMonth + "/" + sDate + "/" + sYear); } } 想請問可以這樣判斷嗎 我有兩個input想要個別抓日曆表格 每次試input都會無法 麻煩大大們 菜鳥發問Q.Q -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.165.193.209 ※ 文章網址: https://www.ptt.cc/bbs/Ajax/M.1543326163.A.F6F.html ※ 編輯: puppyulove (1.165.193.209), 11/27/2018 21:44:10
laechan: 我的話會試試 if(x === y) 11/27 22:16
laechan: 喔沒事,看錯了 11/27 22:17
ccorn: 好像看不出你存x/y的意義,如果是比對id的話$(this).attr(' 11/27 22:59
ccorn: id')===i1我會這樣寫 11/27 22:59
puppyulove: 希望可以點擊個別input抓日曆表 11/28 09:03
puppyulove: 因為好像只會丟到同一個orz 11/28 09:17
wotupset: 點擊 應該是 click吧 你的click怎麼寫的 11/28 10:34
wotupset: https://api.jquery.com/click/ 11/28 10:34