When you test interactivity of a web page by clicking a link or submitting a form, you sometimes don’t want to be redirected to a new page. Using JavaScript in your browser’s console, you can easily make this happen.
- Open your browser’s inspector and inspect the element (link or button) that when clicked on, won’t take you to a new page
- In your browser’s console, add the following JS
$0.addEventListener("click", function(e) { e.preventDefault(); });