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