Share via


DesignerDocument.addScript Method

SharePoint Designer Developer Reference

Adds a script to a specified element for a specified event.

Syntax

expression.addScript(element, event, script, index)

expression   Required. A variable that represents a DesignerDocument object.

Parameters

Name Required/Optional Data Type Description
element Required IHTMLElement Specifies the element that receives the action.
event Required String Specifies the name of the event that causes the script to run.
script Required String Specifies the script that runs when the event occurs.
index Optional Variant Specifies the position of the inserted script.

See Also