Refresh page after clicking button (ok / cancel) Refresh page after clicking button (ok / cancel)

i could use some help. I want the page to refresh when someone clicks 'ok' or 'cancel'

Help is appreciated, thanks alot.

This is the code:

Button

<button class="center" type="submit" style="border: 0; background: transparent">
    <img src="Playbutton.png" width="800" height="400" alt="submit" onclick="clicked();" />
</button>

Javascript

<script type="text/javascript">
    function clicked() {
       if (confirm('You just clicked the button, click ok or cancel to refresh.')) {
           yourformelement.submit();
           location.reload();
       } else {
           return false;
       }
    }

</script>


from Stackoverflow

Comments

Popular posts from this blog

With jQuery, how to automatically select the value of an input text that has been modified with the arrows? With jQuery, how to automatically select the value of an input text that has been modified with the arrows?

Cannot create an instance of a defined class in Javascript Cannot create an instance of a defined class in Javascript

Using Ts-Standard linting, JSDoc comment at beginning of file triggers "This rule requires the `strictNullChecks` compiler option" error Using Ts-Standard linting, JSDoc comment at beginning of file triggers "This rule requires the `strictNullChecks` compiler option" error