Answers for "prevent page refresh javascript onclick"

C#
1

prevent page refresh

// Can be implemented via window.onbeforeunload.
// For example:
<script type="text/javascript">
    window.onbeforeunload = function() {
        return "Are you sure you want to leave?";
    }
</script>
Posted by: Guest on July-03-2021
1

page reloads after onclick

<button onClick="history.go(0);">Refresh Page</button>
Posted by: Guest on March-05-2020
0

stop refreshing page on button click

<form method="POST">
    <button name="data" onclick="return getData()">Click</button>
</form>
Posted by: Guest on September-06-2021

Code answers related to "prevent page refresh javascript onclick"

C# Answers by Framework

Browse Popular Code Answers by Language