<form action="register.php" method="post" id="regform">
<h4>Login info</h4>
<hr><br>
<input type="text" name="username" placeholder="Username"><br><br>
<input type="password" name="password" placeholder="Password"><br><br>
</form>
$(document).ready(function(){
$('#regform').on('submit', function(){
alert($(this).username.val());
return false;
});
});
-
我得到的錯誤:
TypeError: $(...).username is undefined
看不到我在做什麼錯。 。