---
title: HTMLFormElement.action
slug: Web/API/HTMLFormElement/action
tags:
  - API
  - Forms
  - HTML DOM
  - HTMLFormElement
  - NeedsSpecTable
  - NeedsUpdate
  - Property
  - Reference
browser-compat: api.HTMLFormElement.action
---
{{APIRef("HTML DOM")}}

The **`HTMLFormElement.action`** property represents the action
of the {{HTMLElement("form")}} element.

The action of a form is the program that is executed on the server when the form is
submitted. This property can be retrieved or set.

## Syntax

```js
var string = form.action;
form.action = string;
```

## Example

```js
form.action = '/cgi-bin/publish';
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
