I have a button:

```
<input onclick="if (!PreSaveItem()) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$m$g_1b663413_07f2_4335_90bd_e843be587b73$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem", "", true, "", "", false, true))" type="button" target="_self" jQuery1110039212041699899153="167" value="Save"/>

```

When I have an error on form, i remove the attr onclick.... so it wont save the page...
and when i dont have an error, i replace the attr onclick to default...
But when i do this, the onclick function is not executed....
can I declare a function with the my code in a variable?
like this:

```
var onClickBtn = $( 'input' ).attr( 'onclick' );
function myFunc = onClickBtn;
myFunc();

```