$(document).ready(function(){ $("a[href=#]").on("click", function(e){ e.preventDefault(); });//a[href=#] click });//document ready //prevent default to turn off auto refresh