html full form,HTML Form Elements

HTML Form Elements

This chapter describes all HTML form elements.

The Element

The most important form element is the element.

The element can vary in many ways, depending on the type attribute.

4623c7736fd0f05fcedad8caed9f8376.png

All

HTML input types are covered in the next chapter.

The Element (Drop-Down List)

The element defines a drop-down list:

Example

Volvo

Saab

Fiat

Audi

Try it Yourself »

The elements defines the options to select.

The list will normally show the first item as selected.

You can add a selected attribute to define a predefined option.

Example

Fiat

Try it Yourself »

The Element

The element defines a multi-line input field (a text area):

Example

The cat was playing in the garden.

Try it Yourself »

This is how the HTML code above will be displayed in a browser:

The cat was playing in the garden.

The Element

The element defines a clickable button:

Example

οnclick="alert('Hello World!')">Click Me!

Try it Yourself »

This is how the HTML code above will be displayed in a browser:

Click Me!

HTML5 Form Elements

HTML5 added the following form elements:

4623c7736fd0f05fcedad8caed9f8376.png

By default, browsers do not display unknown elements. New elements will not

destroy your page.

HTML5 Element

The element specifies a list of pre-defined options for an element.

Users will see a drop-down list of pre-defined options as they input data.

The list attribute of the element, must refer to the

id attribute of the element.

2b27909812b97ab0f93e2db4726ceb1c.gif

c730540c8c2925eaa2737bf1de8dfff7.gif

5e8d8c7bfacf1fcbe9d4af0037a8dc0a.gif

b26b17988510933b95186013df1f4055.gif

ec0be1d6a53889f638bec0c2d73260bf.gif

Example

An element with pre-defined values in a :

Try it Yourself »

HTML5 Element

The purpose of the element is to provide a secure way to authenticate users.

The element specifies a key-pair generator field in a form.

When the form is submitted, two keys are generated, one private and one public.

The private key is stored locally, and the public key is sent to the server.

The public key could be used to generate a client certificate to authenticate the user in the future.

2b27909812b97ab0f93e2db4726ceb1c.gif

698581461c0c1aca76e3ad7f2161c0ab.gif

5e8d8c7bfacf1fcbe9d4af0037a8dc0a.gif

b26b17988510933b95186013df1f4055.gif

5f195457931d012565fafd29ffe2786e.gif

Example

A form with a keygen field:

Username:

Encryption:

Try it Yourself »

HTML5 Element

The element represents the result of a calculation (like one

performed by a script).

2b27909812b97ab0f93e2db4726ceb1c.gif

698581461c0c1aca76e3ad7f2161c0ab.gif

5e8d8c7bfacf1fcbe9d4af0037a8dc0a.gif

b26b17988510933b95186013df1f4055.gif

5f195457931d012565fafd29ffe2786e.gif

Example

Perform a calculation and show the result in an element:

οninput="x.value=parseInt(a.value)+parseInt(b.value)">

0

100 +

=

Try it Yourself »

Test Yourself with Exercises!

HTML Form Elements

=

new in HTML5.

Tag

Description

Defines an HTML form for user input

Defines an input control

Defines a multiline input control (text area)

Defines a label for an element

Groups related elements in a form

Defines a caption for a

element

Defines a drop-down list

Defines a group of related options in a drop-down list

Defines an option in a drop-down list

Defines a clickable button

Specifies a list of pre-defined options for input controls

Defines a key-pair generator field (for forms)

Defines the result of a calculation

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值