1
不顯示出於某種原因,我的輸入值將不會在控制檯顯示...輸入值在控制檯
這裏是我的代碼,
HTML:
<tr class="area"><td class="icon"></td>
<td class="title">
<div>
User: <input id="inputUser" type="text" style="margin-top: 2px;margin-left:2px"></input>
Ammount: <input id="inputAmmount" type="text" style="margin-top:2px;margin-left:2px; padding-right: 0px"></input>
</div>
<td><a class="btn" style="margin-top:3px">Submit</a></td>
</td>
</tr>
JQUERY
$('.btn').click(function(){
console.log("click detected");
var userID = $('#inputUser').val();
var ammount = $('#inputAmmount').val();
console.log(userID);
});
控制檯正在成功輸出「點擊檢測」,但對於用戶標識,它不顯示任何內容。
你定義的變量'user',但你嘗試登錄'userID' ... – Ian 2014-09-05 22:10:19
控制檯。日誌(用戶)也許.. userId不在那裏。 – 2014-09-05 22:10:27
我的錯誤是在複製粘貼過程中出錯,它仍然不適用於我 – tinthetub 2014-09-05 22:17:09