Ah thanks that worked

but i did have to remove the
[1] from var theNum = this.src.match(/\d/)[1];
else it wouldn't work.
So why doesnt below work?
Code:
<script>
function helpme() { alert("hello"); }
</script>
<input type="button" onClick="helpme()" value="submit me"/>
Thankyou for your help