Answers for "how to return back in js"

2

javascript page back

<button onclick="goBack()">Go Back</button>

<script>
function goBack() {
  window.history.back();
  }
</script>
Posted by: Guest on March-19-2021
7

call back function in javascript

function greeting(name) {
  alert('Hello ' + name);
}

function processUserInput(callback) {
  var name = prompt('Please enter your name.');
  callback(name);
}

processUserInput(greeting);
Posted by: Guest on December-05-2019

Browse Popular Code Answers by Language