Var newScript documentcreateElement script. A key part of the article is this block of code that shows how to dynamically add your JavaScript to the DOM. Var headID documentgetElementsByTagName head 0.