Why enter a search in a form tag?

I found that SO puts the search in the form tag, and I found that some other sites do the same, for example google, they put the search and search input in it:

<form action="/search" method="get" name="gs" id="tsf">

I just want to know the benefits of this, because it seems ordinary I miss.

+3
source share
6 answers

How about reading an HTML form tutorial ?

The data entered in the form must be sent to the server. The attribute actiontells the browser which server.

, : POST ( HTTP) GET ( , URL). , method.

POST , (, ). GET , , ( URL , , , ). : Google GET, GMail POST. .

: , . divo : , . , -: , Google, - Yahoo. .

2:

? W3Schools . - 10

( ), :

+8

action <form> , URL- .

+4

? , , .

: , HTML- .

0

- , (, ) - .

www.w3schools.com, - .

JavaScript , JavaScript, , HTML

0

, , www.igurr.com, , :

, ?

, ASP.NET form body:

<form name="aspnetForm" method="post" action="/default.aspx" id="aspnetForm">
0

, :

, - , , , , .

0

Source: https://habr.com/ru/post/1708586/


All Articles