2022.2

Table Of Contents
html()
html() : String
ReturnstheinnerHTMLofanHTMLelement,whichcanbe:
l
Thefirstelementinasetofelementsthatmatchtheselectorofascript(see"results"on
page1301).
l
Oneelementthatmatchestheselectorofascriptthatrunsfor"Eachmatchedelement"(see
"this"onpage1237and"Settingthescopeofascript"onpage813).
l
Thefirstelementinasetofelementsreturnedbyaqueryinthetemplate(see"query()"on
page1197).
html(value)
ReplacestheinnerHTMLofanHTMLelementorofeachelementinaresultsetwiththesupplied
value.
value
AStringthatmaycontainHTMLtags.
Examples
Thefollowingscriptloadspartofasnippetbasedonthevalueofafield,andtheninsertsthecontent
intothedocumentusinghtml().
var promoTxt = loadhtml('snippets/promo-en.html', '#' + record.fields['YOGA']);
results.html(promoTxt);
Thefollowingscriptloadsasnippet.Thenitlooksforaplaceholder(@var2@)inthetextofthatsnippet
andreplaceseveryfoundplaceholderbythetext'<i>OLConnect1</i>'.Ituseshtml()sotheHTML
formatting(<i>and</i>)willindeedbeinterpretedasHTML.Finally,itplacesthesnippetinthetem-
plate.
var mysnippet = loadhtml('snippets/snippet.html');
mysnippet.find('@var1@').html('<i>OL Connect 1</i>');
results.replaceWith(mysnippet);
info()
ReturnspaginationinformationforoneHTMLelementorforthefirstelementinaresultset(see"res-
ults"onpage1301)ofaqueryacrossallsectionsinaPrintcontext(see"query(selector)"on
page1300).
ThereturnedinformationisofthetypePaginationInfo(see"PaginationInfo"onpage1300).
Page 1224