I'm not a jquery expert by any means and I cannot figure this out. 

```
<input class="button" name="save" type="submit" onclick="$(this).replaceWith('<img src=images/loading.gif />'); console.log(this); $('#myForm').submit();" value="SUBMIT">

```

The code does replace the button but with a broken image icon. However, if I right click the broken image and copy the url its the correct and valid path to the loading.gif.

I also have added the `<script>` tags in the `<head>`.

Anybody have an idea to fix this?

Thanks