We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第235天 请解释下href="javascript:void(0)"和href="#"的区别是什么?
#588
我也要出题
The text was updated successfully, but these errors were encountered:
一个是执行函数,一个是跳转链接,执行函数的可以return一个false 使跳转或者其他事件被阻止
Sorry, something went wrong.
"#" 包含了一个位置信息,默认的锚是#top 也就是网页的上端。而javascript:void(0), 仅仅表示一个死链接。在页面很长的时候会使用 # 来定位页面的具体位置,格式为:# + id。如果你要定义一个死链接请使用 javascript:void(0) 。实例<a href="javascript:void(0);">点我没有反应的!</a><a href="#pos">点我定位到指定位置!</a><br>...<br><p id="pos">尾部定位点</p>
No branches or pull requests
第235天 请解释下href="javascript:void(0)"和href="#"的区别是什么?
#588
我也要出题
The text was updated successfully, but these errors were encountered: