Interview Question

What is the form action attribute?

Action sets the form submission destination.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The `action` attribute sets the URL that receives data when a `<form>` is submitted. β€’ It is written inside an element’s opening tag. β€’ The HTML Standard limits which elements may use it and which values are valid. β€’ Browsers apply the attribute when they process the element or the resource it controls.

💡 Simple Example

<form action="/register" method="post"><label for="name">Name</label><input id="name" name="name"><button type="submit">Register</button></form>

⚡ Quick Revision

Action sets the form submission destination.