Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a form action/url with jquery

How do I get the action url from a form with jquery?

like image 559
Dejan.S Avatar asked Apr 11 '11 11:04

Dejan.S


People also ask

How do I get a form action URL?

prop() returns the full action url: To use the action attribute of a form use: $( '#myForm' ). attr( 'action' ); like @JAAulde said.

What is action in form in JavaScript?

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.


1 Answers

Get the form, ask for the action attribute:

$('#myForm').attr('action'); 
like image 69
JAAulde Avatar answered Oct 15 '22 18:10

JAAulde