The national anthem in sports (an older article)
https://www.cnn.com/2017/09/25/us/nfl-national-anthem-trump-kaepernick-history-trnd/index.html
<snip>
The US Code says you should stand for the anthem
Section 301 of the United States Code says that during a rendition of the national anthem, people "should face the flag and stand at attention with their right hand over the heart" (except for uniformed military personnel, who should stand and salute for the length of the song). If you're wearing a hat you're supposed to take it off.
If no flag is on display, people are supposed to face towards the source of the music and behave in the same manner.
There's a separate US Code section for how to respect the flag, implying that the anthem and flag, while often presented together, are different patriotic entities.
Oddly enough, the US flag code doesn't mention the anthem at all. It does mention the Pledge of Allegiance, which "should be rendered by standing at attention facing the flag with the right hand over the heart."