Application of form objects

form object

document.getElentById();
document.forms.username
document.frm1.username

The properties of the form itself are all properties that can be objects.

action
method
enctype
title

submit()

onfocus(); event
onblur(); event
onchange(); event

form 上  onsubmit();

<form> element

      define html form

<form>
 form elements
</form>

Form elements refer to the different types of input elements, checkboxes, radio buttons, submit buttons, and so on.

<input> element

 The <input> element is the most important form element and has many forms, depending on the type attribute

text defines regular text input
radio defines the radio button input
submit defines the submit button
 
 
<html>
<body>

<form>
Account:<br>
<input type="text" name="账号">
<br>
Password:<br>
<input type="text" name="密码">
<input type="submit" value="Submit">
</form>
</body>
</html>

filedset combined form data

Related data in the fieldset element combination

The legend element defines the title for the fieldest element

<legend>Personal information:</legend>

form attribute list
accept-charset Specifies the character set used in the submitted form
action The address (URL) that specifies where to submit the form
autocomplete Specifies that the browser should autocomplete the form
enctype Specifies the encoding of the submitted data
method Specifies the HTTP method to use when submitting the form
name Specifies the name that identifies the form (for DOM use: document.forms.name).
novalidate Specifies that the browser does not validate the form.
target Specifies the target of the address in the action attribute

password input type

<input type="password"> defines the password field
<form action="">
User name:<br>
<input type="text" name="userid">
<br>
User password:<br>
<input type="password" name="psw">
</form>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325645076&siteId=291194637