Set the name of the form the element belongs to in HTML?

HTMLWeb DevelopmentFront End Technology

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

Example

You can try to run 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>
raja
Published on 14-Mar-2018 12:19:44
Advertisements