Okay, I must be missing something here because this should be extremely simple, yet it doesn't work...
I have a form
on my page with an empty action
attribute (action="#"
). When the page is ready, I want to change the action
attribute to something else. My code is very simple:
HTML:
<form action="#" method="post" id="register"></form>
jQuery:
$("#register").attr("action", "http://www.test.com");
Even in a test fiddle, it doesn't work! View the source of the Result frame and you'll see the value of the action
attribute is still #
.
Where am I going wrong??