How do I get the action url from a form with jquery?
prop() returns the full action url: To use the action attribute of a form use: $( '#myForm' ). attr( 'action' ); like @JAAulde said.
form action javascript. In an HTML form, the action attribute is used to indicate where the form's data is sent to when it is submitted. The value of this can be set when the form is created, but at times you might want to set it dynamically.
Get the form, ask for the action
attribute:
$('#myForm').attr('action');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With