How to change text weight/color on click!

Hello! I am brand new to css and am having trouble figuring this one out. I currently have a heading that is coded to display a drop down when clicked. I would now like this heading to be bold weighted when clicked and the text below is displayed. I have pasted the code I used to create the dropdown, and now I am unsure on how to make the same onclick function to affect the titles weight. I would also appreciate if someone would show an example of how to change the color too incase my client comes back and wants a color flip instead of regular to bold weight text. Thanks!

export function text15_click() {
if ( $w( “#text16” ).collapsed ) {
$w( “#text16” ).expand();
}
else
$w( “#text16” ).collapse();
}