aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/htmlformelement/action/index.html
blob: 32519d4be06123de6f05b5c6015031aa96142e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
title: HTMLFormElement.action
slug: Web/API/HTMLFormElement/action
tags:
  - API
  - DOM节点
  - HTML表单元素
  - 表单
translation_of: Web/API/HTMLFormElement/action
---
<div>{{APIRef("HTML DOM")}}</div>

<p><strong><code>HTMLFormElement.action</code></strong> 这个js语句能够定义一个{{HTMLElement("form")}}元素中的action属性</p>

<p>表单的action属性是在服务器上提交表单,这个属性可以被检索或者设置。</p>

<h2 id="Syntax" name="Syntax">语法</h2>

<pre class="eval"><em>string</em> = form.action
form.action = <em>string </em>
</pre>

<h2 id="Example" name="Example">例子</h2>

<p>form.action = "/cgi-bin/publish";</p>

<h2 id="Specification" name="Specification">详细说明</h2>

<p><a class="external" href="http://www.w3.org/TR/html5/association-of-controls-and-forms.html#dom-fs-method" title="http://www.w3.org/TR/html5/association-of-controls-and-forms.html#dom-fs-method">HTML 5, Section 4.10.19.6, Form submission</a></p>

<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-74049184">DOM Level 2 HTML: action</a></p>