I have the following code with which I can change the value of a button while pressing on it:
HTML:
<input type="submit" value="Submit"/>
<input type="submit" value="Register"/>
jQuery:
$(":submit").click(function() {
$("#test").attr("value", "please wait...");
});
I however would like to change the text in a div when pressing a button. So i have:
<body>
<input type="submit" value="Submit"/>
<input type="submit" value="Register"/>
<div id="test"> </div>
</body>
And would like to change the div from ""
to please...
wait by pressing the submit button:
$(":submit").click(function() {
$("#test").attr("value", "please wait...");
});
This does not work however. Anybody have an idea what I'm doing wrong?