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

How to extract items from a subarray and push them to the main array

Detox gets stuck on JS Timer/Main Run Loop when registering a lot of screens with React Native Navigation Detox gets stuck on JS Timer/Main Run Loop when registering a lot of screens with React Native Navigation

\\u0000 cannot be converted to text error \\u0000 cannot be converted to text error