Today I have learned Form in javascript
Form in javascript:
Forms are the basics of HTML. We use HTML form element in order to create the JavaScript form. For creating a form, we can use the following sample code:
Here, we will learn the method to access the form, getting elements as the JavaScript form's value, and submitting the form.
- Form name tag is used to define the name of the form. The name of the form here is "Login_form". This name will be referenced in the JavaScript form.
- The action tag defines the action, and the browser will take to tackle the form when it is submitted. Here, we have taken no action.
- The method to take action can be either post or get, which is used when the form is to be submitted to the server. Both types of methods have their own properties and rules.
- The input type tag defines the type of inputs we want to create in our form. Here, we have used input type as 'text', which means we will input values as text in the textbox.
- Net, we have taken input type as 'password' and the input value will be password.
- Next, we have taken input type as 'button' where on clicking, we get the value of the form and get displayed.
- <nav class="navbar navbar-expand-sm bg-danger navbar-dark fixed-top" style={{position:"fixed"}}> <form class="d-flex"><input class="form-control me-2" type="text" placeholder="Search"/><button class="btn btn-primary" type="button">Search</button></form></nav>
Comments
Post a Comment