The web browser works through the code sequentially. When the web browser gets to the script code, it knows nothing about the other HTML tags that are below the script. For that reason, it’s best for scripts to be below everything else.
You can easily achieve that by placing the script just before the </body> tag.
I’m aware they’re not required to be unique, but if you’re writing code for something as specific as .australianbrother [name="longliveaustralia"], i’m guessing it’s unique.