# Binding Action

A Binding Action is very similar to Binding, the main difference is that it used at runtime, rather than when the script is loaded.

The main reason to use a Binding Action rather than a regular Binding, is when you want to setup a binding on a HTML element that doesn't exist at the point of the script loading. For example, if you had a image appear on your page as part of a gallery, you may want to apply a Binding Action to it, so that when it is clicked, it disappears.

To use a Binding Action you need to first select what type of event you would like to attach to, for example 'click'. Then select what element on the page you would like to bind to, this may be an existing element, which you can select from the menu, or it may be an element which only comes to exist during running of your site, or dynamically created in PHP or similar. If the latter is the case, you will need type in the id of the element in the usual jQuery notation. Finally, you should select a function to call when the event you have created is fired. This is different to the callback at the end. The callback happens when the binding is created, the function is called when the binding is used.

The easiest way to test your Binding is to create a Custom Code action, and drag from the Binding to the Custom Code action. By default, the Custom Code action will show a dialog using `alert("Hello World!");`. If you can fire the event (by clicking the element it is attached to, for example) and the dialog appears, then the Binding is working.