My question is the CSS syntax. I want to add a CLASS(.fade) to multiple ID(titletext1 and titletext2 or more...). The way I write it does not work. What is the correct syntax if I do not want to group them together, not writing them in separate line ?
document.getElementById('titletext1').classList.add('fade');
document.getElementById('titletext2').classList.add('fade');
#titletext1.fade,
#titletext2.fade {
opacity: 1;
top: 5px;
}
<h1 class="titletext" id=titletext1>This is a Title!!</h1>
<h1 class="titletext" id=titletext2>A second Title!!</h1>
Thanks