I am creating a login form dynamically using jQuery and AJAX answer. The form is created and displayed correctly. But I can not read the form data.
This is my code:
$(document).ready(function(){
$('#proper-form').on( 'click', '#submit-button', function() {
alert ("here");
var username = $('#email').attr('value');
var password = $('#password').attr('value');
alert (password);
alert (username);
});
});
It warns undefined undefinedfor both username and password.
Can someone help me figure out what's wrong here?
source
share