beginner javascript button

I’m really struggling with a basic javascript problem and I can’t find the right way to Google help. I’ve been practicing Javascript, but thus far I’ve mainly been just following prompts, not coding …