i'm trying to set an input value to a var named account after the user hits a button, I've tried this without jquery and everything checks out fine, but this is for an assignment and I must use jquery.
here is the html input and button:
<input type="" class="Re" id="Email1"/>
<button class="Re" id="Start" >Start</button>
Now i set the button to show an alert with the input value in the var account to check if it works, here is the code:
var account = "a";
$(document).ready(function(){
$("#Start").click(function(){
$("#Email1").val(account);
alert(account);
});
});
account it's set on "a" mainly for testing, the "a" doesn't seem to change nothing.
acorrectly. Are you sure you have included the jQuery javascript file into the project?a.account = $("Email1").val()