首页javascriptanchorjQuery HTML Element - 如何单击链接时跳过更改位置

jQuery HTML Element - 如何单击链接时跳过更改位置

我们想知道如何单击链接时跳过更改位置。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $('a').click(function() { 
        $(this).css('background', 'gray');
        return false;
    });
});
</script>
</head>
<body>
  <a href="no-js-link.html">Click action</a>
</body>
</html>