# Script Action Element

Getting Started | API | Elements | Actions | Validators | Handlers | Configuration Options | About

## Table of Contents

- 1 Script Action - #script {}

## 1 Script Action - #script {}

Run some plain Javascript.

You can access Nitrogen elements within the Javascript using the obj('id') function.

For example, if you have a Nitrogen element with the id of 'myTextBox', then "var tb = obj('myTextBox');" will make tb point to the myTextBox element.

In addition, you can use obj('me') to point to the target of the current action, and you can use 'parent' to get the parent of an element, for example: "obj('me.parent.parent')".

### Usage

    wf:wire(myDiv, #event { type=click, actions=#script { script="gotClick(obj('me'));" } })

### Attributes

script - (string)
  The Javascript to execute.

### See Also

- base element

Date: 2012-10-18 03:26:19 CDT

Author: Rusty Klophaus (@rustyio)

Org version 7.8.02 with Emacs version 23

Validate XHTML 1.0

## Comments

Note:To specify code blocks, just use the generic code block syntax:

    <pre><code>your code here</code></pre>

comments powered by Disqus