I'm trying to create a simple function in jquery to direct the user's browser to the previous page if the Cancel button is clicked but I'm a bit mythed as to how to do it since I have minimal experience of jquery.
<input type="button" id="cancelBc2" name="cancelForm" value="Cancel">
$(document.ready(function() {
$('cancelBc2').click(function() {
var cancel = confirm("Are you sure you want to leave the page?");
if (cancel == true) {
window.location = "chooseConfig.php";
}
});
});
Am I missing something or is the page just completely overlooking the
$(document.ready(function()?