> 
> **Possible Duplicate:**  
> 
> [How to dynamically insert a <script> tag via jQuery after page load?](https://stackoverflow.com/questions/3857874/how-to-dynamically-insert-a-script-tag-via-jquery-after-page-load) 
> 
> 
> 

i have this code 

```
var scri = "<script type=\"text/javascript\">var _gaq = _gaq || []; _gaq.push(['setAccount','UA-22xxxxx3-15']); _gax.push(['_trackPageview']); <\/script>";
document.getElementsByTagName("script")[23].add(scri);
console.log(scri);

```

I want to append that element to the head of the document and i tried .append() .text() .add() and a lot of other methods but i get always erros. the last one was

```
Uncaught TypeError: Object #<HTMLScriptElement> has no method 'add'

```

Any idea how can i append this to the head elements?