Script Template

Modifying the script template

The Script template allows you to define templates for the element or artboard.

Web Export adds the script needed to make the element work as closely as possible to what is seen in Adobe XD for the page and the elements.

You can add your own JavaScript by adding it to the Script template for the artboard exported next to the page JavaScript or you can add JavaScript to the selected element exported next to the element markup (separate export positions may be added upon request).

To add JavaScript to an element, select the Element and in the Element Options panel click on the JavaScript template icon.

Next enter some JavaScript. Use the built in tokens to access names and values of the selected element.

Click on the Show Markup button to show the exported HTML and JavaScript.

More tokens:

Exported Markup:

‚Äč

For the Artboard the Script Template refers to the page scripts. It supports the use of a scriptstag as shown below:

The Artboard Script Template does not support Element tokens.