"/> ">

Home  >  Article  >  Web Front-end  >  In HTML, what is the name of the form to which the element belongs?

In HTML, what is the name of the form to which the element belongs?

WBOY
WBOYforward
2023-09-10 23:13:021105browse

In HTML, what is the name of the form to which the element belongs?

Use the form attribute in HTML to set the name of one or more forms to which the element belongs in HTML.

Example

You can try running the following code to implement the form attribute -

<!DOCTYPE html>
<html>
   <body>
      <form action = "" method = "get" id = "myform">
         SubjectID: <input type = "number" name = "subid"><br>
         Subject Name: <input type = "text" name = "subname"><br>
         Total Students: <input type="number" name = "stcount"><br>
      </form>
      <button type = "submit" form = "myform" value = "Submit">Click</button>
   </body>
</html>

The above is the detailed content of In HTML, what is the name of the form to which the element belongs?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete