2022.2

Table Of Contents
var mysnippet = loadhtml('snippets/snippet.html');
mysnippet.find('@var1@').text('OL Connect 1');
mysnippet.find('@var2@').html('<i>OL Connect 2</i>').css('text-decoration','underline');
results.replaceWith(mysnippet);
width()
Getsorsetstheouterwidth,includingpaddingandborders,ofanHTMLelementorofthefirstelement
inresultset(see"results"onpage1301),i.e.thesetofHTMLelementsthatmatchtheselectorofthe
scriptorofanotherqueryinthetemplate(see"query()"onpage1197).
width(): Number
Returnstheouterwidthofthiselement,includingpaddingandborders,excludingmargins.Toinclude
margins,callwidth(true).
Thereturnedvalueisthewidthinpixels,withoutmeasurementunit(e.g.400).
width(value): void
Setstheouterwidthofthiselement,includingpaddingandborders,excludingmargins.Toincludemar-
gins,callwidth(value, true).
value
Number.Givethewidthinpixels,butwithoutthemeasurementunit(e.g.400,not400px).
Examples
Thisscriptadds20pixelstothewidthandheightofanelement.
var h = results.height();
var w = results.width();
h = h + 20;
w = w + 20;
results.height( h );
results.width( w );
Thefollowingscriptdoesthesame,butinthiscase,marginsareincluded.
var h = results.height(true);
var w = results.width(true);
h = h + 20;
w = w + 20;
results.height( h, true);
results.width( w, true);
Page 1236