That is not the way to go there, that actually is not JavaScript since it is not in a script tag.
Why are you not outputting that directly with the serverside code to start out with. Using JavaScript here is probably the wrong solution unless the value changes as the user interacts with the page.