Reputation: 241
How to get a form
element's id
using JavaScript, when you have the form
object.
Using form.id
would be good, but if the form
has an <input id="id">
it returns that input
object instead of the id
of the form
element.
Upvotes: 0
Views: 3666
Reputation: 8401
You can use getAttribute("id");
to get the id of the form.
Upvotes: 5