2022.2

Table Of Contents
Thefollowingscriptdoesthesame,butitonlysetsthetextcolortoredifinthecurrentrecordthevalue
ofthefield'accounttype'is'PRO'.
if(record.fields.accounttype == "PRO") {
query("#callout p").css("color","red");
}
Thisscriptsetsthetextcoloroftheresultstoahexadecimalcolorcode.
results.css('color' , '#669900');
Thisscriptloadsasnippetintoavariable.Thenitfinds/replacestextinthesnippetandappliesacss
propertytothereplacingtext.
var mysnippet = loadhtml('snippets/snippet vars.html');
mysnippet.find('@var@').text('OL Connect').css('text-decoration','underline');
results.replaceWith(mysnippet);
css(properties)
FunctiontosetoneormultipleCSSpropertiesofoneormoreHTMLelements,whichcanbe:
l
Theelementsthatmatchtheselectorofascript(see"results"onpage844).
l
Oneelementthatmatchestheselectorofascriptthatrunsfor"Eachmatchedelement"(see
"this"onpage781and"Settingthescopeofascript"onpage373).
l
Theelementsreturnedbyaqueryinthetemplate(see"query()"onpage742).
properties
Array;mapofproperty-valuepairstoset.
Examples
Thisscriptcolorsthetextoftheresults(thesetofHTMLelementsthatmatchtheselectorofthe
script)redandmakesitbold.
results.css({'color' : 'red', 'font-weight' : 'bold'});
empty()
Removesthecontents(childelementsandinnerHTML)fromoneormoreHTMLelements,whichcan
be:
Page 797