Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
The <form> tag is used to create a section on a web page that allows users to enter and submit information, such as names, emails, or feedback, to a server.
The <form> tag acts as a container for all form elements and defines where and how the form data should be sent when the form is submitted.
The 'action' attribute specifies the URL or file where the form data will be sent after submission.
<form action="submit.php" method="get">
</form>
GET sends data through the URL and is visible in the address bar, suitable for non-sensitive data. POST sends data in the request body, making it more secure for sensitive information.
The POST method is more secure for sending login or personal data because the information is not shown in the URL.
The 'name' attribute gives a name to the form so that it can be referenced easily in scripts like JavaScript.
<form id="studentForm"></form>
By using the CSS selector: #form1 { background-color: lightyellow; }
Because all input fields, buttons, and other interactive elements of the form must be placed inside the <form> tag to function together as a single form.
If 'action' is left empty, the form data is sent to the same page on which the form is present.
You can refer to it as document.loginForm in JavaScript.
The 'id' attribute gives the form a unique identifier, which can be used to access or style it with JavaScript or CSS.
The four important attributes are: action, method, name, and id.
All input elements should be inside the <form> tag so that their data can be collected and sent together when the form is submitted.
The opening tag is <form> and the closing tag is </form>.
<form action="submit.php" method="post" name="myForm" id="mainForm">
</form>
The browser uses the value of the 'method' attribute (either 'get' or 'post') to decide how to send the form data.
The <form> tag is essential because it allows the collection of user input and enables interactive web pages that can send information to servers for processing.
Together, 'action' and 'method' control where the form data is sent and how the data is transmitted when the form is submitted.