What is the purpose of the method attribute in a form element?
Difficulty level
To define how long the form should be displayed.
To define the type of browser to open the form in.
To specify the HTTP method to use when sending form data.
To specify the way data is displayed on submission.
The method attribute in an HTML form specifies the HTTP method to use when sending form data. Common values for this attribute include "GET" and "POST". The "GET" method appends form data to the URL in name/value pairs, which is ideal for non-sensitive data and when you want to bookmark the result. The "POST" method, on the other hand, sends the form data as the HTTP message body, making it more suitable for sending large amounts or sensitive data.