html – Is JavaScript added and executed during rendering or parsing?

AFAIK creates each website in a two-step process: Analyze and Render. When parsing, the markup (Say HTML) is taken over unchanged or created from a server-side programming language such as PHP.

In rendering, the style (such as CSS) is added to the parsed structures.

I do not know where JavaScript comes from when parsing or rendering:

Is JavaScript added and executed during rendering or parsing?