2022.2

Table Of Contents
Incode,youcanchangeanelement'sattributeusingthefunctionattr();see"Writingyourown
scripts"onpage368and"StandardScriptAPI"onpage715.
Inserting an element
Toinsertanelementinasection:
1. Navigatetowhereyouwanttoinserttheelement,usingthearrowkeys,themouse,theBread-
crumbs(see"Selectinganelement"onthefacingpage)ortheOutlinepane.
2. Clicktherespectivetoolbarbutton.Alternatively,clicktheelementontheInsertmenu.
3. AddanIDand/oraclass.ID'sandclassesareparticularlyusefulwithregardtovariabledata(see
"Personalizingcontent"onpage297)andstyling(see"StylingtemplateswithCSSfiles"on
page261).
Note: DonotgiveanelementtheID'pages'ortheclassname'dynamic'.Theseare
reservedwords.UsingthemasanIDorclassnameleadstoundesirableeffects.
4. UsetheLocationdrop-down(ifavailable)toselectwheretoinserttheelement.
l
At cursor positioninsertsitwherethecursorislocatedinthetemplate.
l
Before elementinsertsitbeforetheHTMLelementinwhichthecursoriscurrentlyloc-
ated.Forexampleifthecursoriswithinaparagraph,theinsertionpointwillbebeforethe
<p>tag.*
l
After start taginsertsitwithinthecurrentHTMLelement,atthebeginning,justafterthe
starttag.*
l
Before end taginsertsitwithinthecurrentHTMLelement,attheend,justbeforetheend
tag.*
l
After elementinsertsitaftertheelementinwhichthecursoriscurrentlylocated.For
exampleifthecursoriswithinaparagraph,theinsertionpointwillbeaftertheendtagof
theparagraph(</p>).*
l
Replaceinsertsitinplaceofthecurrentlyselectedelement.(Thisoptionisnotavailable
wheninsertingcontentinaMasterPage.)
*Ifthecurrentelementislocatedinsideanotherelement,usetheElementsdrop-downtoselect
whichelementisusedfortheinsertionlocation.Thelistdisplayseveryelementinthebread-
crumbs,fromthecurrentselectionpointdowntotherootofthebody.
Note: HTMLhassomerestrictionsastowhichtypesofelementsareallowedaschildrenof
otherelements.Forexample,aparagraphelementisnotallowedtohavechildrenthatare
blocklevelelements-likeaDivoraTable.Ifinsertingcontentattheselectedlocation
Page 173