html(value)

Replaces the contents of the <body> of a section or Master Page with the supplied value. This function is only available in Control Scripts. See also: section and masterpage.

value

A String that may contain HTML tags.

Examples

The following script loads a snippet based on the value of a field, and then replaces the content of a Print section with the snippet using html().

var mySection = merge.template.contexts.PRINT.sections["Section 1"];
var promoTxt = loadhtml('snippets/promo-' + record.fields['City'] + '.html', );
mySection.html(promoTxt);