4.2.6  重写表单中的某些属性

4.2.6 重写表单中的某些属性

在HTML 5中,通过表单重写属性“form override attributes”可以重写<form>元素的某些属性设定。HTML 5中的表单重写属性有:

■formaction:重写表单的action属性。

■formenctype:重写表单的enctype属性。

■formmethod:重写表单的method属性。

■formnovalidate:重写表单的novalidate属性。

■formtarget:重写表单的target属性。

表单重写属性适用于以下类型的<input>标签:

■submit(https://www.daowen.com)

■image

下面通过一个实例讲解重写表单中的某些属性的方法。

图示

实例文件12.html的代码如下。

图示

执行后的效果如图4-20所示。

图示

图4-20 执行效果