$(function() { $('input[value=Cancel]').click(function() {history.go(-1);}); }); javascript code example Example: js go back history.back()