jQuery 1.4.2 - Potential IE8 bug setting action attribute on form
I'm trying to set the action on the submit event handler in IE8, and get the error "Object doesn't support this property or method"
This doesn't happen in Firefox or Safari.
The Form:
- <form name="product" id="product" action="http://example.com">
- <!-- snip form -->
- </form>
The jQuery code with the error in IE8:
- $('#product').change(function () { changes = true; }).submit(function() {
- this.action = 'http://example2.com';
- });
Also tried this with the same error:
- $('#product').change(function () { changes = true; }).submit(function() {
- $(this).attr('action','http://example2.com');
- });
and for good measure, this one liner also does the same thing:
- $('#product').attr('action','http://example2.com');
This, however, works without an error:
- $('#product').change(function () { changes = true; }).submit(function() {
- this.setAttribute('action','http://example2.com');
- });
Is this a jQuery bug?